Ejemplo n.º 1
0
ssize_t mailstream_low_write(mailstream_low * s,
    const void * buf, size_t count)
{
  ssize_t r;
  
  if (s == NULL)
    return -1;

#ifdef STREAM_DEBUG
  STREAM_LOG(s, 1, ">>>>>>> send >>>>>>\n");
  if (s->privacy) {
    STREAM_LOG_BUF(s, 1, buf, count);
  }
  else {
    STREAM_LOG_BUF(s, 2, buf, count);
  }
  STREAM_LOG(s, 1, "\n");
  STREAM_LOG(s, 1, ">>>>>>> end send >>>>>>\n");
#endif

  r = s->driver->mailstream_write(s, buf, count);
  
  if (r < 0) {
    STREAM_LOG_ERROR(s, 4 | 1, buf, 0);
  }
  
  return r;
}
Ejemplo n.º 2
0
ssize_t mailstream_low_write(mailstream_low * s,
    const void * buf, size_t count)
{
  if (s == NULL)
    return -1;

#ifdef STREAM_DEBUG
  if (s->privacy) {
    STREAM_LOG_BUF(s, 1, buf, count);
  }
  else {
    STREAM_LOG_BUF(s, 2, buf, count);
  }
  STREAM_LOG(s, 1, "\n");
#endif

  return s->driver->mailstream_write(s, buf, count);
}
Ejemplo n.º 3
0
ssize_t mailstream_low_read(mailstream_low * s, void * buf, size_t count)
{
  ssize_t r;
  
  if (s == NULL)
    return -1;
  r = s->driver->mailstream_read(s, buf, count);
  
#ifdef STREAM_DEBUG
  if (r > 0) {
    STREAM_LOG_BUF(s, 0, buf, r);
    STREAM_LOG(s, 0, "\n");
  }
#endif
  
  return r;
}