27 return (buf->
used == 0 ? 1 : 0); }
29 return (buf->
used > 0 ? 1 : 0); }
40 static unsigned int buffer_adddata(
buffer_t *buf,
const unsigned char *
ptr,
48 memcpy(buf->
data + buf->
used, ptr, added);
56 unsigned int moved, tomove = from->
used;
61 moved = buffer_adddata(to, from->
data, tomove);
64 buffer_takedata(from, NULL, moved);
69 static unsigned int buffer_takedata(
buffer_t *buf,
unsigned char *ptr,
72 unsigned int taken = buf->
used;
78 memcpy(ptr, buf->
data, taken);
108 towrite = write(fd, buf->
data, towrite);
110 buffer_takedata(buf, NULL, towrite);
120 static void int_ssl_check(
SSL *s,
int ret)
162 int_ssl_check(ssl, ret);
172 buffer_takedata(buf, NULL, ret);
176 int_ssl_check(ssl, ret);
198 buffer_takedata(buf, NULL, ret);