aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2000-03-29 21:44:22 +0000
committerEric S. Raymond <esr@thyrsus.com>2000-03-29 21:44:22 +0000
commit48529e5bfe1b1f9eb2bf9482c2c9469772020441 (patch)
tree86ac549d0748602a1c72c1ab84963065401e6b86
parent359d7a680954c070e905000809b29ad02539f2ff (diff)
downloadfetchmail-48529e5bfe1b1f9eb2bf9482c2c9469772020441.tar.gz
fetchmail-48529e5bfe1b1f9eb2bf9482c2c9469772020441.tar.bz2
fetchmail-48529e5bfe1b1f9eb2bf9482c2c9469772020441.zip
Eliminate the IDLING variable.
svn path=/trunk/; revision=2845
-rw-r--r--fetchmail.h3
-rw-r--r--imap.c11
2 files changed, 8 insertions, 6 deletions
diff --git a/fetchmail.h b/fetchmail.h
index d23e9127..cca85409 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -401,7 +401,8 @@ extern int phase;
#define STAGE_GETRANGE 1
#define STAGE_GETSIZES 2
#define STAGE_FETCH 3
-#define STAGE_LOGOUT 4
+#define STAGE_IDLE 4
+#define STAGE_LOGOUT 5
extern int stage;
extern int mytimeout;
diff --git a/imap.c b/imap.c
index 6f6645ce..88591311 100644
--- a/imap.c
+++ b/imap.c
@@ -98,14 +98,14 @@ int imap_ok(int sock, char *argbuf)
* see an EXISTS. Only after that will a tagged response be
* shipped. The idling flag also gets cleared on a timeout.
*/
- if (idling)
+ if (stage == STAGE_IDLE)
{
/* we do our own write and report here to disable tagging */
SockWrite(sock, "DONE\r\n", 6);
if (outlevel >= O_MONITOR)
report(stdout, "IMAP> DONE\n");
- idling = FALSE;
+ stage = STAGE_FETCH;
}
}
if (strstr(buf, "RECENT"))
@@ -925,7 +925,6 @@ int imap_getauth(int sock, struct query *ctl, char *greeting)
* Handle idling. We depend on coming through here on startup
* and after each timeout (including timeouts during idles).
*/
- idling = FALSE;
if (strstr(capabilities, "IDLE") && ctl->idle)
{
do_idle = TRUE;
@@ -1084,10 +1083,12 @@ static int imap_getrange(int sock,
if (deletions && expunge_period != 1)
ok = internal_expunge(sock);
count = -1;
- idling = do_idle;
- if (idling)
+ if (do_idle)
+ {
+ stage = STAGE_IDLE;
/* this is the RFC2177-recommended timeout for an IDLE */
mytimeout = 29 * 60;
+ }
if (ok || gen_transact(sock, do_idle ? "IDLE" : "NOOP"))
{
report(stderr, _("re-poll failed\n"));