From b60e74f6ad5328170127d753620c9ead1a087bad Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 27 May 2012 17:25:47 -0500 Subject: [PATCH] Fix IMAP hang on auth failure This closes Bug 1007 Thanks to Francois Andriot for the patch! (cherry picked from commit aa2af2573ba32542b7f8422c4c0d7f142edd9d95) --- kioslaves/imap4/imapparser.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kioslaves/imap4/imapparser.cc b/kioslaves/imap4/imapparser.cc index 6ba434a4..cb3ac21e 100644 --- a/kioslaves/imap4/imapparser.cc +++ b/kioslaves/imap4/imapparser.cc @@ -277,11 +277,11 @@ imapParser::clientAuthenticate ( KIO::SlaveBase *slave, KIO::AuthInfo &ai, } cmd = sendCommand (new imapCommand ("AUTHENTICATE", firstCommand.latin1())); - while ( true ) + int pl = 0; + while ( pl != -1 && !cmd->isComplete () ) { //read the next line - while (parseLoop() == 0) ; - if ( cmd->isComplete() ) break; + while ((pl = parseLoop()) == 0) ; if (!continuation.isEmpty()) {