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

dovecot at dovecot.org dovecot at dovecot.org
Thu Aug 6 22:56:36 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/ae00eda5b152
changeset: 9285:ae00eda5b152
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 8ea90a23ed74 -r ae00eda5b152 src/lib-storage/index/index-mail-headers.c
--- a/src/lib-storage/index/index-mail-headers.c	Tue Aug 04 16:58:33 2009 -0400
+++ b/src/lib-storage/index/index-mail-headers.c	Thu Aug 06 15:56:31 2009 -0400
@@ -371,9 +371,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
@@ -382,9 +382,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 8ea90a23ed74 -r ae00eda5b152 src/lib-storage/index/index-mail.h
--- a/src/lib-storage/index/index-mail.h	Tue Aug 04 16:58:33 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