dovecot: Parse keywords from header immediately when mapping the...

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 27 18:28:57 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/1b0db9d04b2e
changeset: 6324:1b0db9d04b2e
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Aug 27 18:28:53 2007 +0300
description:
Parse keywords from header immediately when mapping the index file.

diffstat:

2 files changed, 9 insertions(+), 6 deletions(-)
src/lib-index/mail-index-map.c |   11 +++++++++--
src/lib-index/mail-index.c     |    4 ----

diffs (37 lines):

diff -r 4a6dd4e894b4 -r 1b0db9d04b2e src/lib-index/mail-index-map.c
--- a/src/lib-index/mail-index-map.c	Mon Aug 27 18:28:30 2007 +0300
+++ b/src/lib-index/mail-index-map.c	Mon Aug 27 18:28:53 2007 +0300
@@ -681,10 +681,17 @@ static int mail_index_map_latest_file(st
 	if (ret > 0) {
 		/* make sure the header is ok before using this mapping */
 		ret = mail_index_check_header(new_map);
-		if (ret >= 0)
+		if (ret >= 0) {
 			ret = mail_index_parse_extensions(new_map);
-		if (ret++ == 0)
+			if (ret > 0) {
+				if (mail_index_map_parse_keywords(new_map) < 0)
+					ret = -1;
+			}
+		}
+		if (ret == 0)
 			index->fsck = TRUE;
+		else if (ret < 0)
+			ret = 0;
 	}
 	if (ret <= 0) {
 		mail_index_unmap(&new_map);
diff -r 4a6dd4e894b4 -r 1b0db9d04b2e src/lib-index/mail-index.c
--- a/src/lib-index/mail-index.c	Mon Aug 27 18:28:30 2007 +0300
+++ b/src/lib-index/mail-index.c	Mon Aug 27 18:28:53 2007 +0300
@@ -322,10 +322,6 @@ int mail_index_map_parse_keywords(struct
 
 const ARRAY_TYPE(keywords) *mail_index_get_keywords(struct mail_index *index)
 {
-	/* Make sure all the keywords are in index->keywords. It's quick to do
-	   if nothing has changed. */
-	(void)mail_index_map_parse_keywords(index->map);
-
 	return &index->keywords;
 }
 


More information about the dovecot-cvs mailing list