[haiku-commits] r40976 - haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib

  • From: clemens.zeidler@xxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 16 Mar 2011 20:46:01 +0100 (CET)

Author: czeidler
Date: 2011-03-16 20:46:01 +0100 (Wed, 16 Mar 2011)
New Revision: 40976
Changeset: http://dev.haiku-os.org/changeset/40976

Modified:
   
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.cpp
Log:
Disconnect connection if login failed.



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-16 19:12:30 UTC (rev 40975)
+++ 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.cpp
        2011-03-16 19:46:01 UTC (rev 40976)
@@ -198,14 +198,17 @@
 
        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;
 }
 


Other related posts:

  • » [haiku-commits] r40976 - haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib - clemens . zeidler