changeset 18737:8906101589f9

fts: Fixed fts_enforced=yes when it has to wait for indexing to finish
author Timo Sirainen <tss@iki.fi>
date Thu, 21 May 2015 22:41:43 -0400
parents b29b48376fb4
children fd8edab94849
files src/plugins/fts/fts-storage.c
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/fts/fts-storage.c	Thu May 21 22:20:10 2015 -0400
+++ b/src/plugins/fts/fts-storage.c	Thu May 21 22:41:43 2015 -0400
@@ -280,11 +280,7 @@
 	struct fts_mailbox *fbox = FTS_CONTEXT(ctx->transaction->box);
 	struct fts_search_context *fctx = FTS_CONTEXT(ctx);
 
-	if (fctx == NULL) {
-		/* no fts */
-	} else if (!fctx->fts_lookup_success && fctx->enforced) {
-		return FALSE;
-	} else if (fctx->indexer_ctx != NULL) {
+	if (fctx != NULL && fctx->indexer_ctx != NULL) {
 		/* this command is still building the indexes */
 		if (!fts_mailbox_build_continue(ctx)) {
 			*tryagain_r = TRUE;
@@ -295,6 +291,8 @@
 			return FALSE;
 		}
 	}
+	if (fctx != NULL && !fctx->fts_lookup_success && fctx->enforced)
+		return FALSE;
 
 	return fbox->module_ctx.super.
 		search_next_nonblock(ctx, mail_r, tryagain_r);