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

  • From: clemens.zeidler@xxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 6 Mar 2011 08:42:20 +0100 (CET)

Author: czeidler
Date: 2011-03-06 08:42:20 +0100 (Sun, 06 Mar 2011)
New Revision: 40831
Changeset: http://dev.haiku-os.org/changeset/40831

Modified:
   
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/ServerConnection.cpp
Log:
Add some check if we are still connected.



Modified: 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/ServerConnection.cpp
===================================================================
--- 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/ServerConnection.cpp
    2011-03-06 07:36:45 UTC (rev 40830)
+++ 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/ServerConnection.cpp
    2011-03-06 07:42:20 UTC (rev 40831)
@@ -158,6 +158,9 @@
 status_t
 SocketConnection::Connect(const char* server, uint32 port)
 {
+       if (fSocket >= 0)
+               Disconnect();
+
        TRACE("SocketConnection to server %s:%i\n", server, (int)port);
        uint32 hostIP = inet_addr(server);
                // first see if we can parse it as a numeric address
@@ -249,6 +252,9 @@
 status_t
 SSLConnection::Connect(const char* server, uint32 port)
 {
+       if (fSSL != NULL)
+               Disconnect();
+
        BAutolock _(fLocker);
 
        status_t status = SocketConnection::Connect(server, port);


Other related posts:

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