<<< Date Index >>>     <<< Thread Index >>>

Re: Timeouts?



Hi,

* Rocco Rutte wrote:

> [4f67fc336986] removes the imap_keepalive() call from the pager's main
> loop and calls it everytime in km_dokey(). The change in [12a6de725483]
> however only calls imap_keepalive() if $imap_keepalive < $timeout. Maybe
> we need something like this handling the $imap_keepalive >= $timeout
> case:

Here we go, Kyle can you try this one, please?

Regards, Rocco

# HG changeset patch
# User Rocco Rutte <rocco.rutte@xxxxxxxxxxx>
# Date 1221059942 -7200
# Branch HEAD
# Node ID a2ddd8bae12a8997d0bded3f3368aa830670c445
# Parent  17adea9cdff6dcd97b800f5061272360cdebacd1
Fix IMAP keepalive if $imap_keepalive >= $timeout

diff -r 17adea9cdff6 -r a2ddd8bae12a keymap.c
--- a/keymap.c  Mon Sep 01 18:23:35 2008 +0200
+++ b/keymap.c  Wed Sep 10 17:19:02 2008 +0200
@@ -390,16 +390,22 @@
     i = Timeout > 0 ? Timeout : 60;
 #ifdef USE_IMAP
     /* keepalive may need to run more frequently than Timeout allows */
-    while (ImapKeepalive && ImapKeepalive < i)
+    if (ImapKeepalive)
     {
-      timeout (ImapKeepalive * 1000);
-      tmp = mutt_getch ();
-      timeout (-1);
-      if (tmp.ch != -2)
-        /* something other than timeout */
-        goto gotkey;
-      i -= ImapKeepalive;
-      imap_keepalive ();
+      if (ImapKeepalive >= i)
+       imap_keepalive ();
+      else
+       while (ImapKeepalive && ImapKeepalive < i)
+       {
+         timeout (ImapKeepalive * 1000);
+         tmp = mutt_getch ();
+         timeout (-1);
+         if (tmp.ch != -2)
+           /* something other than timeout */
+           goto gotkey;
+         i -= ImapKeepalive;
+         imap_keepalive ();
+       }
     }
 #endif