From aa2af2573ba32542b7f8422c4c0d7f142edd9d95 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 27 May 2012 17:25:47 -0500 Subject: Fix IMAP hang on auth failure This closes Bug 1007 Thanks to Francois Andriot for the patch! --- 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 791e78fa6..f916d8294 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()) { -- cgit v1.2.1