[dovecot-cvs] dovecot/src/lib-storage/index index-search.c,1.44,1.45

cras at procontrol.fi cras at procontrol.fi
Sat Nov 30 16:36:22 EET 2002


Update of /home/cvs/dovecot/src/lib-storage/index
In directory danu:/tmp/cvs-serv15771/lib-storage/index

Modified Files:
	index-search.c 
Log Message:
Non-envelope-cached header searching wasn't working. Also now search works
with messages having 8bit headers, assuming them being in same charset as
search key.



Index: index-search.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-search.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- index-search.c	26 Nov 2002 13:07:53 -0000	1.44
+++ index-search.c	30 Nov 2002 14:36:20 -0000	1.45
@@ -556,13 +556,12 @@
 	if (!have_headers && !have_body && !have_text)
 		return TRUE;
 
-	if (!imap_msgcache_get_rfc822(search_open_cache(ctx), &inbuf,
-				      have_headers ? NULL : &hdr_size, NULL))
-		return FALSE;
-
 	if (have_headers || have_text) {
 		SearchHeaderContext hdr_ctx;
 
+		if (!imap_msgcache_get_data(search_open_cache(ctx), &inbuf))
+			return FALSE;
+
 		memset(&hdr_ctx, 0, sizeof(hdr_ctx));
 		hdr_ctx.index_context = ctx;
 		hdr_ctx.custom_header = TRUE;
@@ -570,6 +569,10 @@
 
 		message_parse_header(NULL, inbuf, &hdr_size,
 				     search_header, &hdr_ctx);
+	} else {
+		if (!imap_msgcache_get_rfc822(search_open_cache(ctx), &inbuf,
+					      &hdr_size, NULL))
+			return FALSE;
 	}
 
 	if (have_text || have_body) {




More information about the dovecot-cvs mailing list