Example #1
0
static int send_data(mailsmtp * session, const char * message, size_t size)
{
  if (session->smtp_progress_fun != NULL) {
    if (mailstream_send_data_with_context(session->stream, message, size,
                             session->smtp_progress_fun, session->smtp_progress_context) == -1)
      return -1;
  }
  else {
    if (mailstream_send_data(session->stream, message, size,
                             session->progr_rate, session->progr_fun) == -1)
      return -1;
  }

  if (mailstream_flush(session->stream) == -1)
    return -1;

  return 0;
}
Example #2
0
static void send_data(newsnntp * f, const char * message, uint32_t size)
{
  mailstream_send_data(f->nntp_stream, message, size,
		       f->nntp_progr_rate, f->nntp_progr_fun);
}