]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
index-mail: Expose tee_stream so plugins can read the stream too while mail is being...
authorTimo Sirainen <tss@iki.fi>
Thu, 6 Aug 2009 19:56:31 +0000 (15:56 -0400)
committerTimo Sirainen <tss@iki.fi>
Thu, 6 Aug 2009 19:56:31 +0000 (15:56 -0400)
--HG--
branch : HEAD

src/lib-storage/index/index-mail-headers.c
src/lib-storage/index/index-mail.h

index 6724a2d3029e5370a270697fa6d8b7a0e9e34c4f..a0e454a3e56a5eb0b349fac4b201c823e65fa78a 100644 (file)
@@ -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 =
index 26940ce23452d952c0c5743723a9f5ee7311e631..d0df9e2a08f7e71a40cdcc3c1d0669888f1c6bef 100644 (file)
@@ -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;