]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
IDLE fixes..
authorTimo Sirainen <tss@iki.fi>
Sun, 24 Aug 2003 12:58:13 +0000 (15:58 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 24 Aug 2003 12:58:13 +0000 (15:58 +0300)
--HG--
branch : HEAD

src/imap/cmd-idle.c
src/lib-storage/index/index-mailbox-check.c
src/lib-storage/index/index-storage.h

index 5e2d651de40e19b118bec81c3f870f91a3bf0b7d..c8fe1fcb16fceb1fc1d6862a9c2c0dd8cf1592c9 100644 (file)
@@ -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) {
index ca69e17291e0355757a1e2d7acaccfba0c3daeeb..40a326bac66ee5620a1c483529b116d4d1fce120 100644 (file)
@@ -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;
index 67a2b59fc13b06990a32058f85f55953fa304ff3..94620237b7417ce1c6b62fb36927a7733f57f037 100644 (file)
@@ -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() */