[dovecot-cvs] dovecot/src/lib-storage/index index-mail-headers.c, 1.71, 1.72 index-mail.h, 1.45, 1.46 index-search.c, 1.128, 1.129
tss at dovecot.org
tss at dovecot.org
Wed Apr 4 07:47:17 EEST 2007
Update of /var/lib/cvs/dovecot/src/lib-storage/index
In directory talvi:/tmp/cvs-serv17848/lib-storage/index
Modified Files:
index-mail-headers.c index-mail.h index-search.c
Log Message:
Don't feed index_mail_parser headers while searching message bodies, unless
we actually need something from there.
Index: index-mail-headers.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-mail-headers.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- index-mail-headers.c 3 Apr 2007 16:22:41 -0000 1.71
+++ index-mail-headers.c 4 Apr 2007 04:47:14 -0000 1.72
@@ -171,6 +171,12 @@
return header_field.idx;
}
+bool index_mail_want_parse_headers(struct index_mail *mail)
+{
+ return mail->wanted_headers != NULL || mail->data.save_sent_date ||
+ mail->data.save_bodystructure_header;
+}
+
void index_mail_parse_header_init(struct index_mail *mail,
struct mailbox_header_lookup_ctx *_headers)
{
Index: index-mail.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-mail.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- index-mail.h 2 Nov 2006 18:18:25 -0000 1.45
+++ index-mail.h 4 Apr 2007 04:47:14 -0000 1.46
@@ -135,6 +135,7 @@
int index_mail_set_uid(struct mail *mail, uint32_t uid);
void index_mail_free(struct mail *mail);
+bool index_mail_want_parse_headers(struct index_mail *mail);
void index_mail_parse_header_init(struct index_mail *mail,
struct mailbox_header_lookup_ctx *headers);
void index_mail_parse_header(struct message_part *part,
Index: index-search.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-search.c,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -d -r1.128 -r1.129
--- index-search.c 3 Apr 2007 18:18:08 -0000 1.128
+++ index-search.c 4 Apr 2007 04:47:14 -0000 1.129
@@ -597,9 +597,11 @@
hdr_ctx.index_context = ctx;
hdr_ctx.custom_header = TRUE;
hdr_ctx.args = args;
- hdr_ctx.parse_headers = headers == NULL;
+ hdr_ctx.parse_headers = headers == NULL &&
+ index_mail_want_parse_headers(ctx->imail);
- index_mail_parse_header_init(ctx->imail, headers_ctx);
+ if (hdr_ctx.parse_headers)
+ index_mail_parse_header_init(ctx->imail, headers_ctx);
message_parse_header(input, NULL, search_header, &hdr_ctx);
if (headers_ctx != NULL)
mailbox_header_lookup_deinit(&headers_ctx);
More information about the dovecot-cvs
mailing list