summaryrefslogtreecommitdiff
path: root/imap4d
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2003-01-29 13:05:19 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2003-01-29 13:05:19 +0000
commitb2291f9867971c78193eff58135f190dfd93818f (patch)
tree2cfb28113707ee74bffd4a25c47ca2d9958c9bea /imap4d
parenta2868695237cb5a3f831a57d1579a0774f1d2edc (diff)
downloadmailutils-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.c4
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 ();

Return to:

Send suggestions and report system problems to the System administrator.