dovecot-1.1: If underlying stream doesn't support seeking, don't...

dovecot at dovecot.org dovecot at dovecot.org
Thu Feb 28 06:27:05 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/c75b2e1fa5a2
changeset: 7301:c75b2e1fa5a2
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Feb 28 06:29:43 2008 +0200
description:
If underlying stream doesn't support seeking, don't try to seek to original
position.

diffstat:

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

diffs (20 lines):

diff -r f0c7e9198313 -r c75b2e1fa5a2 src/lib/istream-limit.c
--- a/src/lib/istream-limit.c	Thu Feb 28 06:28:54 2008 +0200
+++ b/src/lib/istream-limit.c	Thu Feb 28 06:29:43 2008 +0200
@@ -13,10 +13,12 @@ static void i_stream_limit_destroy(struc
 {
 	struct limit_istream *lstream = (struct limit_istream *) stream;
 
-	/* get to same position in parent stream */
-	i_stream_seek(lstream->istream.parent,
-		      lstream->istream.parent_start_offset +
-		      lstream->istream.istream.v_offset);
+	if (lstream->istream.parent->seekable) {
+		/* 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_unref(&lstream->istream.parent);
 }
 


More information about the dovecot-cvs mailing list