From: Timo Sirainen Date: Mon, 8 Nov 2010 18:30:05 +0000 (+0000) Subject: istream-tee: Fixed to work right when input stream didn't start from offset 0. X-Git-Tag: 2.0.7~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=106e86d8bfdfebd3ff55241845920ea3b47e0ba2;p=thirdparty%2Fdovecot%2Fcore.git istream-tee: Fixed to work right when input stream didn't start from offset 0. --- diff --git a/src/lib/istream-tee.c b/src/lib/istream-tee.c index a126231594..bf5dea691f 100644 --- a/src/lib/istream-tee.c +++ b/src/lib/istream-tee.c @@ -192,9 +192,12 @@ struct tee_istream *tee_i_stream_create(struct istream *input) 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; }