From c8f061869e69eae3fffa76962ff963d4d7988029 Mon Sep 17 00:00:00 2001 From: Brendan Cully Date: Mon, 19 Dec 2005 18:03:41 +0000 Subject: [PATCH] Catch another possible race when starting IDLE. --- imap/imap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/imap/imap.c b/imap/imap.c index d34baf02..51de3db5 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -1284,7 +1284,9 @@ int imap_check_mailbox (CONTEXT *ctx, int *index_hint, int force) do result = imap_cmd_step (idata); while (result == IMAP_CMD_CONTINUE); - if (result != IMAP_CMD_RESPOND) + /* it's possible that we were notified and fetched mail before + * getting to the +, in which case we've automatically unidled. */ + if (result != IMAP_CMD_RESPOND && result != IMAP_CMD_OK) { dprint (1, (debugfile, "Error starting IDLE\n")); idata->state = IMAP_SELECTED; -- 2.40.0