dovecot-2.0: istream-tee: Fixed to work right when input stream ...

dovecot at dovecot.org dovecot at dovecot.org
Mon Nov 8 20:30:08 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/2a252c9cda5e
changeset: 12397:2a252c9cda5e
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Nov 08 18:30:05 2010 +0000
description:
istream-tee: Fixed to work right when input stream didn't start from offset 0.

diffstat:

 src/lib/istream-tee.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (19 lines):

diff -r 11169c6c6e8d -r 2a252c9cda5e src/lib/istream-tee.c
--- a/src/lib/istream-tee.c	Mon Nov 08 18:03:07 2010 +0000
+++ b/src/lib/istream-tee.c	Mon Nov 08 18:30:05 2010 +0000
@@ -192,9 +192,12 @@
 	struct tee_istream *tee;
 
 	tee = i_new(struct tee_istream, 1);
-	tee->input = input;
-
-	i_stream_ref(input);
+	if (input->v_offset == 0) {
+		i_stream_ref(input);
+		tee->input = input;
+	} else {
+		tee->input = i_stream_create_limit(input, (uoff_t)-1);
+	}
 	return tee;
 }
 


More information about the dovecot-cvs mailing list