dovecot-2.1: imapc: Added assert.

dovecot at dovecot.org dovecot at dovecot.org
Sun Sep 4 11:30:18 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/44e3c053f9f8
changeset: 13377:44e3c053f9f8
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Sep 04 10:55:33 2011 +0300
description:
imapc: Added assert.

diffstat:

 src/lib-storage/index/imapc/imapc-client.c  |  5 +++++
 src/lib-storage/index/imapc/imapc-client.h  |  1 +
 src/lib-storage/index/imapc/imapc-storage.c |  1 +
 3 files changed, 7 insertions(+), 0 deletions(-)

diffs (37 lines):

diff -r e1a8ad9c83cd -r 44e3c053f9f8 src/lib-storage/index/imapc/imapc-client.c
--- a/src/lib-storage/index/imapc/imapc-client.c	Sun Sep 04 10:48:46 2011 +0300
+++ b/src/lib-storage/index/imapc/imapc-client.c	Sun Sep 04 10:55:33 2011 +0300
@@ -136,6 +136,11 @@
 		io_loop_stop(client->ioloop);
 }
 
+bool imapc_client_is_running(struct imapc_client *client)
+{
+	return client->ioloop != NULL;
+}
+
 void imapc_client_stop_now(struct imapc_client *client)
 {
 	client->stop_now = TRUE;
diff -r e1a8ad9c83cd -r 44e3c053f9f8 src/lib-storage/index/imapc/imapc-client.h
--- a/src/lib-storage/index/imapc/imapc-client.h	Sun Sep 04 10:48:46 2011 +0300
+++ b/src/lib-storage/index/imapc/imapc-client.h	Sun Sep 04 10:55:33 2011 +0300
@@ -117,6 +117,7 @@
 /* Stop immediately, don't finish even any already read pending replies.
    They'll be finished when imapc_client_run() is again called. */
 void imapc_client_stop_now(struct imapc_client *client);
+bool imapc_client_is_running(struct imapc_client *client);
 
 struct imapc_client_mailbox *
 imapc_client_mailbox_open(struct imapc_client *client,
diff -r e1a8ad9c83cd -r 44e3c053f9f8 src/lib-storage/index/imapc/imapc-storage.c
--- a/src/lib-storage/index/imapc/imapc-storage.c	Sun Sep 04 10:48:46 2011 +0300
+++ b/src/lib-storage/index/imapc/imapc-storage.c	Sun Sep 04 10:55:33 2011 +0300
@@ -542,6 +542,7 @@
 	} else {
 		/* remote server doesn't support IDLE.
 		   check for changes with NOOP every once in a while. */
+		i_assert(!imapc_client_is_running(mbox->storage->client));
 		mbox->to_idle_check =
 			timeout_add(box->notify_min_interval * 1000,
 				    imapc_idle_timeout, mbox);


More information about the dovecot-cvs mailing list