[dovecot-cvs] dovecot/src/lib ostream-crlf.c,1.2,1.3
cras at dovecot.org
cras at dovecot.org
Sun Aug 22 14:19:54 EEST 2004
Update of /home/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv5372/lib
Modified Files:
ostream-crlf.c
Log Message:
send_istream() didn't work properly.
Index: ostream-crlf.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/ostream-crlf.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ostream-crlf.c 22 Aug 2004 05:46:50 -0000 1.2
+++ ostream-crlf.c 22 Aug 2004 11:19:52 -0000 1.3
@@ -236,14 +236,16 @@
_send_istream(struct _ostream *outstream, struct istream *instream)
{
struct const_iovec iov;
+ const unsigned char *data;
size_t sent = 0;
ssize_t ret;
- while ((ret = i_stream_read(instream)) != -1) {
- if (ret == 0)
+ while ((ret = i_stream_read_data(instream, &data,
+ &iov.iov_len, 0)) != -1) {
+ if (iov.iov_len == 0)
return sent;
- iov.iov_base = i_stream_get_data(instream, &iov.iov_len);
+ iov.iov_base = data;
ret = o_stream_sendv(&outstream->ostream, &iov, 1);
if (ret <= 0)
return ret < 0 && sent == 0 ? -1 : (ssize_t)sent;
More information about the dovecot-cvs
mailing list