diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.cpp b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.cpp index 44ca668ec1..b66886e465 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.cpp @@ -214,8 +214,7 @@ status_t IMAPProtocol::Disconnect() { ProcessCommand("LOGOUT"); - fIsConnected = false; - return fOwnServerConnection.Disconnect(); + return _Disconnect(); } @@ -294,7 +293,7 @@ IMAPProtocol::SendCommand(const char* command, int32 commandId) 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 @@ IMAPProtocol::HandleResponse(int32 commandId, bigtime_t timeout) 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 @@ IMAPProtocol::_ProcessCommandWithoutAfterQuake(const char* command, return HandleResponse(commandId, timeout); } + + +status_t +IMAPProtocol::_Disconnect() +{ + fIsConnected = false; + return fOwnServerConnection.Disconnect(); +} diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.h b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.h index e23a255603..ec51427e4c 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.h +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.h @@ -112,6 +112,7 @@ private: status_t _ProcessCommandWithoutAfterQuake( const char* command, bigtime_t timeout = kIMAP4ClientTimeout); + status_t _Disconnect(); int32 fCommandId; std::vector fOngoingCommands;