dovecot-1.2: thread indexes: Fixed infinite loop.

dovecot at dovecot.org dovecot at dovecot.org
Thu Jun 12 02:15:52 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.2/rev/6659785091ab
changeset: 7827:6659785091ab
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jun 12 01:42:21 2008 +0300
description:
thread indexes: Fixed infinite loop.

diffstat:

1 file changed, 7 insertions(+), 2 deletions(-)
src/lib-storage/index/index-thread.c |    9 +++++++--

diffs (40 lines):

diff -r b63aa0ffe564 -r 6659785091ab src/lib-storage/index/index-thread.c
--- a/src/lib-storage/index/index-thread.c	Thu Jun 12 00:31:59 2008 +0300
+++ b/src/lib-storage/index/index-thread.c	Thu Jun 12 01:42:21 2008 +0300
@@ -181,6 +181,7 @@ mail_thread_try_use_hash(struct mail_thr
 			 const struct mailbox_status *status, bool reset,
 			 struct mail_search_args *search_args)
 {
+	struct mail_search_arg *limit_arg = NULL;
 	const struct mail_hash_header *hdr;
 	struct mail_hash_transaction *hash_trans;
 	uint32_t last_seq, last_uid, seq1, seq2;
@@ -276,8 +277,7 @@ again:
 				seq_range_array_add_range(&arg->value.seqset,
 							  seq2 + 1, last_seq);
 			}
-			ctx->tmp_search_arg.next = search_args->args;
-			search_args->args = &ctx->tmp_search_arg;
+			limit_arg = &ctx->tmp_search_arg;
 		}
 	} else {
 		/* empty hash - make sure anyway that it gets reset */
@@ -291,6 +291,7 @@ again:
 				MAIL_HASH_LOCK_FLAG_CREATE_MISSING) <= 0)
 			return FALSE;
 		shared_lock = TRUE;
+		limit_arg = NULL;
 		goto again;
 	}
 	if (!can_use) {
@@ -299,6 +300,10 @@ again:
 		return FALSE;
 	} else {
 		ctx->thread_ctx.hash_trans = hash_trans;
+		if (limit_arg != NULL) {
+			limit_arg->next = search_args->args;
+			search_args->args = limit_arg;
+		}
 		return TRUE;
 	}
 }


More information about the dovecot-cvs mailing list