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

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


details:   http://hg.dovecot.org/dovecot/rev/ade241ae256e
changeset: 7296:ade241ae256e
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Feb 28 06:29:40 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 e063797bdcd5 -r ade241ae256e src/lib/istream-limit.c
--- a/src/lib/istream-limit.c	Thu Feb 28 06:28:51 2008 +0200
+++ b/src/lib/istream-limit.c	Thu Feb 28 06:29:40 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