Author: czeidler Date: 2011-03-06 08:36:45 +0100 (Sun, 06 Mar 2011) New Revision: 40830 Changeset: http://dev.haiku-os.org/changeset/40830 Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.cpp haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.h Log: Fix endless loop when try to logout and the connection is already lost. Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.cpp =================================================================== --- haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.cpp 2011-03-05 23:11:48 UTC (rev 40829) +++ haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.cpp 2011-03-06 07:36:45 UTC (rev 40830) @@ -214,8 +214,7 @@ IMAPProtocol::Disconnect() { ProcessCommand("LOGOUT"); - fIsConnected = false; - return fOwnServerConnection.Disconnect(); + return _Disconnect(); } @@ -294,7 +293,7 @@ int commandLength = strlen(cmd); if (fServerConnection->Write(cmd, commandLength) != commandLength) { // we might lost the connection, clear the connection state - Disconnect(); + _Disconnect(); return B_ERROR; } @@ -317,7 +316,7 @@ TRACE("S:read error %s", line.String()); // we might lost the connection, clear the connection state TRACE("Disconnect\n"); - Disconnect(); + _Disconnect(); return status; } //TRACE("S: %s", line.String()); @@ -410,3 +409,11 @@ return HandleResponse(commandId, timeout); } + + +status_t +IMAPProtocol::_Disconnect() +{ + fIsConnected = false; + return fOwnServerConnection.Disconnect(); +} Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.h =================================================================== --- haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.h 2011-03-05 23:11:48 UTC (rev 40829) +++ haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.h 2011-03-06 07:36:45 UTC (rev 40830) @@ -112,6 +112,7 @@ status_t _ProcessCommandWithoutAfterQuake( const char* command, bigtime_t timeout = kIMAP4ClientTimeout); + status_t _Disconnect(); int32 fCommandId; std::vector<int32> fOngoingCommands;