Disconnect connection if login failed.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40976 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler 2011-03-16 19:46:01 +00:00
parent 3f9320c6a2
commit 86be65dc7a

View File

@ -198,14 +198,17 @@ IMAPProtocol::Connect(const char* server, const char* username,
TRACE("Login\n");
fIsConnected = true;
BString command = "LOGIN ";
command << "\"" << username << "\" ";
command << "\"" << password << "\"";
status = ProcessCommand(command);
if (status != B_OK)
if (status != B_OK) {
_Disconnect();
return status;
}
fIsConnected = true;
return B_OK;
}