From: Timo Sirainen Date: Sun, 24 Aug 2003 12:58:13 +0000 (+0300) Subject: IDLE fixes.. X-Git-Tag: 1.1.alpha1~4374 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22bd0d8cf3031acfe9928d2680d8d9609ed1b1f2;p=thirdparty%2Fdovecot%2Fcore.git IDLE fixes.. --HG-- branch : HEAD --- diff --git a/src/imap/cmd-idle.c b/src/imap/cmd-idle.c index 5e2d651de4..c8fe1fcb16 100644 --- a/src/imap/cmd-idle.c +++ b/src/imap/cmd-idle.c @@ -10,7 +10,6 @@ #define DEFAULT_IDLE_CHECK_INTERVAL 30 -#include "imap-fetch.h" static void idle_finish(struct client *client, int done_ok) { if (client->idle_to != NULL) { diff --git a/src/lib-storage/index/index-mailbox-check.c b/src/lib-storage/index/index-mailbox-check.c index ca69e17291..40a326bac6 100644 --- a/src/lib-storage/index/index-mailbox-check.c +++ b/src/lib-storage/index/index-mailbox-check.c @@ -30,7 +30,8 @@ static void check_timeout(void *context) if (sync) { ibox->box.sync(&ibox->box, ibox->autosync_flags); - ibox->autosync_pending = FALSE; + ibox->sync_last_notify = ioloop_time; + ibox->autosync_pending = FALSE; } } @@ -38,10 +39,11 @@ static void notify_callback(void *context) { struct index_mailbox *ibox = context; - if ((unsigned int) (ioloop_time - ibox->sync_last_check) >= + ibox->sync_last_check = ioloop_time; + if ((unsigned int) (ioloop_time - ibox->sync_last_notify) >= ibox->min_newmail_notify_interval) { - ibox->sync_last_check = ioloop_time; ibox->box.sync(&ibox->box, ibox->autosync_flags); + ibox->sync_last_notify = ioloop_time; ibox->autosync_pending = FALSE; } else { ibox->autosync_pending = TRUE; diff --git a/src/lib-storage/index/index-storage.h b/src/lib-storage/index/index-storage.h index 67a2b59fc1..94620237b7 100644 --- a/src/lib-storage/index/index-storage.h +++ b/src/lib-storage/index/index-storage.h @@ -33,7 +33,7 @@ struct index_mailbox { struct index_autosync_file *autosync_files; struct index_autosync_io *autosync_ios; enum mailbox_sync_flags autosync_flags; - time_t sync_last_check; + time_t sync_last_check, sync_last_notify; unsigned int min_newmail_notify_interval; struct index_mail fetch_mail; /* fetch_uid() or fetch_seq() */