dovecot: Stating seekable stream didn't restore read conditions ...

dovecot at dovecot.org dovecot at dovecot.org
Thu Nov 8 21:26:01 EET 2007


details:   http://hg.dovecot.org/dovecot/rev/2259ec6c009a
changeset: 6746:2259ec6c009a
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Nov 08 21:17:14 2007 +0200
description:
Stating seekable stream didn't restore read conditions correctly. Also it
returned broken values with larger streams.

diffstat:

1 file changed, 3 insertions(+), 1 deletion(-)
src/lib/istream-seekable.c |    4 +++-

diffs (20 lines):

diff -r 55853fd9d2cf -r 2259ec6c009a src/lib/istream-seekable.c
--- a/src/lib/istream-seekable.c	Thu Nov 08 20:52:29 2007 +0200
+++ b/src/lib/istream-seekable.c	Thu Nov 08 21:17:14 2007 +0200
@@ -272,13 +272,15 @@ i_stream_seekable_stat(struct istream_pr
 		   we're finished */
 		old_offset = stream->istream.v_offset;
 		do {
-			i_stream_skip(&stream->istream, stream->skip);
+			i_stream_skip(&stream->istream,
+				      stream->pos - stream->skip);
 		} while ((ret = i_stream_seekable_read(stream)) > 0);
 
 		if (ret == 0) {
 			i_panic("i_stream_stat() used for non-blocking "
 				"seekable stream");
 		}
+		i_stream_skip(&stream->istream, stream->pos - stream->skip);
 		i_stream_seek(&stream->istream, old_offset);
 	}
 


More information about the dovecot-cvs mailing list