dovecot-2.0: header filter istream: Avoid seeking backwards when...

dovecot at dovecot.org dovecot at dovecot.org
Tue Jun 1 18:01:44 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/941608f8b3fb
changeset: 11440:941608f8b3fb
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jun 01 16:01:21 2010 +0100
description:
header filter istream: Avoid seeking backwards when caller just wants to reset the stream buffers.

diffstat:

 src/lib-mail/istream-header-filter.c |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (18 lines):

diff -r 55b8480849b0 -r 941608f8b3fb src/lib-mail/istream-header-filter.c
--- a/src/lib-mail/istream-header-filter.c	Mon May 31 21:38:19 2010 +0100
+++ b/src/lib-mail/istream-header-filter.c	Tue Jun 01 16:01:21 2010 +0100
@@ -353,6 +353,14 @@
 	struct header_filter_istream *mstream =
 		(struct header_filter_istream *)stream;
 
+	if (stream->istream.v_offset == v_offset) {
+		/* just reset the input buffer */
+		stream_reset_to(mstream, v_offset);
+		i_stream_seek(mstream->istream.parent,
+			      mstream->istream.parent_expected_offset);
+		return;
+	}
+
 	if (v_offset == 0) {
 		/* seeking to beginning of headers. */
 		stream_reset_to(mstream, 0);


More information about the dovecot-cvs mailing list