[dovecot-cvs] dovecot/src/lib-storage/index index-search.c, 1.102, 1.103

cras at dovecot.org cras at dovecot.org
Sat Apr 23 19:51:23 EEST 2005


Update of /var/lib/cvs/dovecot/src/lib-storage/index
In directory talvi:/tmp/cvs-serv31082

Modified Files:
	index-search.c 
Log Message:
Don't call index_mail_parse_header() twice when searching headers. Caused
assert-crashes.



Index: index-search.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-search.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- index-search.c	17 Apr 2005 15:43:45 -0000	1.102
+++ index-search.c	23 Apr 2005 16:51:21 -0000	1.103
@@ -33,7 +33,7 @@
 	pool_t hdr_pool;
 	const char *error;
 
-	int failed;
+	unsigned int failed:1;
 };
 
 struct search_header_context {
@@ -42,6 +42,7 @@
 
         struct message_header_line *hdr;
 
+	unsigned int parse_headers:1;
 	unsigned int custom_header:1;
 	unsigned int threading:1;
 };
@@ -423,7 +424,8 @@
 	if (hdr->eoh)
 		return;
 
-	index_mail_parse_header(NULL, hdr, ctx->index_context->imail);
+	if (ctx->parse_headers)
+		index_mail_parse_header(NULL, hdr, ctx->index_context->imail);
 
 	if (ctx->custom_header || strcasecmp(hdr->name, "Date") == 0) {
 		ctx->hdr = hdr;
@@ -498,6 +500,7 @@
 		hdr_ctx.index_context = ctx;
 		hdr_ctx.custom_header = TRUE;
 		hdr_ctx.args = args;
+		hdr_ctx.parse_headers = headers == NULL;
 
 		index_mail_parse_header_init(ctx->imail, headers_ctx);
 		message_parse_header(NULL, input, NULL,



More information about the dovecot-cvs mailing list