diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2003-01-29 13:05:19 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2003-01-29 13:05:19 +0000 |
commit | b2291f9867971c78193eff58135f190dfd93818f (patch) | |
tree | 2cfb28113707ee74bffd4a25c47ca2d9958c9bea /imap4d | |
parent | a2868695237cb5a3f831a57d1579a0774f1d2edc (diff) | |
download | mailutils-b2291f9867971c78193eff58135f190dfd93818f.tar.gz mailutils-b2291f9867971c78193eff58135f190dfd93818f.tar.bz2 |
Do not wait for 'DONE' command longer than timeout seconds.
Diffstat (limited to 'imap4d')
-rw-r--r-- | imap4d/idle.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/imap4d/idle.c b/imap4d/idle.c index 0f9f170bf..fafdba821 100644 --- a/imap4d/idle.c +++ b/imap4d/idle.c @@ -21,6 +21,7 @@ int imap4d_idle (struct imap4d_command *command, char *arg) { char *sp; + time_t start; if (util_getword (arg, &sp)) return util_finish (command, RESP_BAD, "Too many args"); @@ -31,6 +32,7 @@ imap4d_idle (struct imap4d_command *command, char *arg) util_send ("+ idling\r\n"); util_flush_output (); + start = time (NULL); while (1) { if (util_wait_input (5)) @@ -46,6 +48,8 @@ imap4d_idle (struct imap4d_command *command, char *arg) if (rc) break; } + else if (time (NULL) - start > daemon_param.timeout) + imap4d_bye (ERR_TIMEOUT); imap4d_sync (); util_flush_output (); |