21 |
imap4d_idle (struct imap4d_command *command, char *arg) |
imap4d_idle (struct imap4d_command *command, char *arg) |
22 |
{ |
{ |
23 |
char *sp; |
char *sp; |
24 |
|
time_t start; |
25 |
|
|
26 |
if (util_getword (arg, &sp)) |
if (util_getword (arg, &sp)) |
27 |
return util_finish (command, RESP_BAD, "Too many args"); |
return util_finish (command, RESP_BAD, "Too many args"); |
32 |
util_send ("+ idling\r\n"); |
util_send ("+ idling\r\n"); |
33 |
util_flush_output (); |
util_flush_output (); |
34 |
|
|
35 |
|
start = time (NULL); |
36 |
while (1) |
while (1) |
37 |
{ |
{ |
38 |
if (util_wait_input (5)) |
if (util_wait_input (5)) |
48 |
if (rc) |
if (rc) |
49 |
break; |
break; |
50 |
} |
} |
51 |
|
else if (time (NULL) - start > daemon_param.timeout) |
52 |
|
imap4d_bye (ERR_TIMEOUT); |
53 |
|
|
54 |
imap4d_sync (); |
imap4d_sync (); |
55 |
util_flush_output (); |
util_flush_output (); |