dovecot-1.1: Seek also non-seekable parent streams to current of...

dovecot at dovecot.org dovecot at dovecot.org
Sat Mar 1 00:15:38 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/fce616c59597
changeset: 7311:fce616c59597
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Mar 01 00:15:34 2008 +0200
description:
Seek also non-seekable parent streams to current offset as long as we're not
seeking backwards.

diffstat:

1 file changed, 6 insertions(+), 4 deletions(-)
src/lib/istream-limit.c |   10 ++++++----

diffs (22 lines):

diff -r 18766f26a7ed -r fce616c59597 src/lib/istream-limit.c
--- a/src/lib/istream-limit.c	Fri Feb 29 11:21:11 2008 +0200
+++ b/src/lib/istream-limit.c	Sat Mar 01 00:15:34 2008 +0200
@@ -12,12 +12,14 @@ static void i_stream_limit_destroy(struc
 static void i_stream_limit_destroy(struct iostream_private *stream)
 {
 	struct limit_istream *lstream = (struct limit_istream *) stream;
+	uoff_t v_offset;
 
-	if (lstream->istream.parent->seekable) {
+	v_offset = lstream->istream.parent_start_offset +
+		lstream->istream.istream.v_offset;
+	if (lstream->istream.parent->seekable ||
+	    v_offset > lstream->istream.parent->v_offset) {
 		/* get to same position in parent stream */
-		i_stream_seek(lstream->istream.parent,
-			      lstream->istream.parent_start_offset +
-			      lstream->istream.istream.v_offset);
+		i_stream_seek(lstream->istream.parent, v_offset);
 	}
 	i_stream_unref(&lstream->istream.parent);
 }


More information about the dovecot-cvs mailing list