From f753f6edfbd78c639800c40ba047587df84d0f9a Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Fri, 18 Jun 2010 11:29:05 -0700 Subject: [PATCH] Fix bug in IMAP idle, reduce IDLE timeout. --- src/mail.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mail.c b/src/mail.c index 60249b3..2c042a4 100644 --- a/src/mail.c +++ b/src/mail.c @@ -793,9 +793,9 @@ static void *imap_thread(void *arg) while (1) { /* * RFC 2177 says we have to re-idle every 29 minutes. - * We'll do it every 20 minutes to be safe. + * We'll do it every 10 minutes to be safe. */ - fetchtimeout.tv_sec = 1200; + fetchtimeout.tv_sec = 600; fetchtimeout.tv_usec = 0; DBGP2("idling..."); FD_ZERO(&fdset); @@ -814,7 +814,7 @@ static void *imap_thread(void *arg) fail++; break; } - } else { + } else if (fetchtimeout.tv_sec > 0) { fail++; break; } @@ -837,7 +837,6 @@ static void *imap_thread(void *arg) timed_thread_lock(mail->p_timed_thread); if (mail->messages != messages) { force_check = 1; - mail->messages = messages; } timed_thread_unlock(mail->p_timed_thread); } -- 1.7.9.5