[dovecot-cvs] dovecot/src/lib-mail istream-header-filter.c, 1.37, 1.38
tss at dovecot.org
tss at dovecot.org
Tue Feb 6 10:43:33 UTC 2007
Update of /var/lib/cvs/dovecot/src/lib-mail
In directory talvi:/tmp/cvs-serv19732
Modified Files:
istream-header-filter.c
Log Message:
_read() could have returned "need more data" in wrong situations, which
could have caused problems later.
Index: istream-header-filter.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-mail/istream-header-filter.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- istream-header-filter.c 6 Feb 2007 10:40:15 -0000 1.37
+++ istream-header-filter.c 6 Feb 2007 10:43:31 -0000 1.38
@@ -216,6 +216,9 @@
mstream->header_size.virtual_size +
mstream->header_size.physical_size);
+ stream->pos -= stream->skip;
+ stream->skip = 0;
+
stream->buffer = i_stream_get_data(mstream->input, &pos);
if (pos <= stream->pos) {
if ((ret = i_stream_read(mstream->input)) == -2) {
@@ -228,9 +231,6 @@
ret = 0;
}
- stream->pos -= stream->skip;
- stream->skip = 0;
-
ret = pos > stream->pos ? (ssize_t)(pos - stream->pos) :
(ret == 0 ? 0 : -1);
stream->pos = pos;
More information about the dovecot-cvs
mailing list