Exemple #1
0
mailstream * mailstream_ssl_open_with_callback_timeout(int fd, time_t timeout,
    void (* callback)(struct mailstream_ssl_context * ssl_context, void * data), void * data)
{
#ifdef USE_SSL
  mailstream_low * low;
  mailstream * s;

  low = mailstream_low_ssl_open_with_callback_timeout(fd, timeout, callback, data);
  if (low == NULL)
    goto err;

  s = mailstream_new(low, 8192);
  if (s == NULL)
    goto free_low;

  return s;

 free_low:
  mailstream_low_close(low);
 err:
  return NULL;
#else
  return NULL;
#endif
}
Exemple #2
0
int mailstream_close(mailstream * s)
{
  mailstream_low_close(s->low);
  mailstream_low_free(s->low);
  
  free(s->read_buffer);
  free(s->write_buffer);
  
  free(s);

  return 0;
}
Exemple #3
0
int mailstream_close(mailstream * s)
{
  if (s->idle != NULL) {
    mailstream_cancel_free(s->idle);
  }
  
  mailstream_low_close(s->low);
  mailstream_low_free(s->low);
  
  free(s->read_buffer);
  free(s->write_buffer);
  
  free(s);

  return 0;
}
Exemple #4
0
mailstream * mailstream_socket_open_timeout(int fd, time_t timeout)
{
  mailstream_low * low;
  mailstream * s;

  low = mailstream_low_socket_open(fd);
  if (low == NULL)
    goto err;
	mailstream_low_set_timeout(low, timeout);

  s = mailstream_new(low, 8192);
  if (s == NULL)
    goto free_low;

  return s;

 free_low:
  mailstream_low_close(low);
 err:
  return NULL;
}