From: Brenden Matthews Date: Sat, 30 May 2009 05:31:03 +0000 (-0600) Subject: Be more graceful when handling IMAP problems. X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;ds=sidebyside;h=39071d28e8d9bdcbf7ae7b75d12ba28c994457b4;hp=a31efb7fbefecf587c457cd2e83127ae134a7ee3;p=monky Be more graceful when handling IMAP problems. --- diff --git a/src/mail.c b/src/mail.c index 305c8c6..c1117d1 100644 --- a/src/mail.c +++ b/src/mail.c @@ -566,6 +566,7 @@ void *imap_thread(void *arg) break; } } else { + fail++; break; } recvbuf[numbytes] = '\0'; @@ -643,12 +644,16 @@ void *imap_thread(void *arg) // need to re-connect break; } + } else { + fail++; + break; } imap_unseen_command(mail, old_unseen, old_messages); fail = 0; old_unseen = mail->unseen; old_messages = mail->messages; } + if (fail) break; } else { strncpy(sendbuf, "a3 logout\r\n", MAXDATASIZE); if (send(sockfd, sendbuf, strlen(sendbuf), 0) == -1) {