Fix endless loop when try to logout and the connection is already lost.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40830 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
2440159a1e
commit
faad334022
@ -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();
|
||||
}
|
||||
|
@ -112,6 +112,7 @@ private:
|
||||
status_t _ProcessCommandWithoutAfterQuake(
|
||||
const char* command,
|
||||
bigtime_t timeout = kIMAP4ClientTimeout);
|
||||
status_t _Disconnect();
|
||||
|
||||
int32 fCommandId;
|
||||
std::vector<int32> fOngoingCommands;
|
||||
|
Loading…
Reference in New Issue
Block a user