dovecot-2.0: index-mail: Expose tee_stream so plugins can read t...

dovecot at dovecot.org dovecot at dovecot.org
Thu Aug 6 22:57:52 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/80c0e8bd1e47
changeset: 9737:80c0e8bd1e47
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Aug 06 15:56:31 2009 -0400
description:
index-mail: Expose tee_stream so plugins can read the stream too while mail is being read.

diffstat:

2 files changed, 5 insertions(+), 4 deletions(-)
src/lib-storage/index/index-mail-headers.c |    8 ++++----
src/lib-storage/index/index-mail.h         |    1 +

diffs (38 lines):

diff -r d9a96da46d4a -r 80c0e8bd1e47 src/lib-storage/index/index-mail-headers.c
--- a/src/lib-storage/index/index-mail-headers.c	Wed Aug 05 20:30:43 2009 -0400
+++ b/src/lib-storage/index/index-mail-headers.c	Thu Aug 06 15:56:31 2009 -0400
@@ -370,9 +370,9 @@ index_mail_cache_parse_init(struct mail 
 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->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 -r d9a96da46d4a -r 80c0e8bd1e47 src/lib-storage/index/index-mail.h
--- a/src/lib-storage/index/index-mail.h	Wed Aug 05 20:30:43 2009 -0400
+++ b/src/lib-storage/index/index-mail.h	Thu Aug 06 15:56:31 2009 -0400
@@ -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;


More information about the dovecot-cvs mailing list