From: Timo Sirainen Date: Thu, 6 Aug 2009 19:56:31 +0000 (-0400) Subject: index-mail: Expose tee_stream so plugins can read the stream too while mail is being... X-Git-Tag: 2.0.alpha1~315 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6f6f3dc5b33b09097192124bce17b7017d6bbfcf;p=thirdparty%2Fdovecot%2Fcore.git index-mail: Expose tee_stream so plugins can read the stream too while mail is being read. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/index-mail-headers.c b/src/lib-storage/index/index-mail-headers.c index 6724a2d302..a0e454a3e5 100644 --- a/src/lib-storage/index/index-mail-headers.c +++ b/src/lib-storage/index/index-mail-headers.c @@ -370,9 +370,9 @@ struct istream * index_mail_cache_parse_init(struct mail *_mail, struct istream *input) { struct index_mail *mail = (struct index_mail *)_mail; - struct tee_istream *tee; struct istream *input2; + i_assert(mail->data.tee_stream == NULL); i_assert(mail->data.parser_ctx == NULL); /* we're doing everything for now, figure out later if we want to @@ -381,9 +381,9 @@ index_mail_cache_parse_init(struct mail *_mail, struct istream *input) mail->data.save_bodystructure_header = TRUE; mail->data.save_bodystructure_body = TRUE; - tee = tee_i_stream_create(input); - input = tee_i_stream_create_child(tee); - input2 = tee_i_stream_create_child(tee); + mail->data.tee_stream = tee_i_stream_create(input); + input = tee_i_stream_create_child(mail->data.tee_stream); + input2 = tee_i_stream_create_child(mail->data.tee_stream); index_mail_parse_header_init(mail, NULL); mail->data.parser_ctx = diff --git a/src/lib-storage/index/index-mail.h b/src/lib-storage/index/index-mail.h index 26940ce234..d0df9e2a08 100644 --- a/src/lib-storage/index/index-mail.h +++ b/src/lib-storage/index/index-mail.h @@ -89,6 +89,7 @@ struct index_mail_data { unsigned int dont_cache_field_idx; struct istream *stream, *filter_stream; + struct tee_istream *tee_stream; struct message_size hdr_size, body_size; struct message_parser_ctx *parser_ctx; int parsing_count;