From 86be65dc7a37f59b2a8bf74ff6adf467c6c42ae7 Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Wed, 16 Mar 2011 19:46:01 +0000 Subject: [PATCH] Disconnect connection if login failed. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40976 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../inbound_protocols/imap/imap_lib/IMAPProtocol.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 62df05c955..8255cc84e4 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 @@ -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; }