From 8c018efae7242d6591d5aab21abb76ba0a0a0bfb Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Sun, 6 Mar 2011 07:42:20 +0000 Subject: [PATCH] Add some check if we are still connected. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40831 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../inbound_protocols/imap/imap_lib/ServerConnection.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/ServerConnection.cpp b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/ServerConnection.cpp index 597c85ebe9..70553ac9a9 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/ServerConnection.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/ServerConnection.cpp @@ -158,6 +158,9 @@ SocketConnection::SocketConnection() 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 @@ SSLConnection::SSLConnection() status_t SSLConnection::Connect(const char* server, uint32 port) { + if (fSSL != NULL) + Disconnect(); + BAutolock _(fLocker); status_t status = SocketConnection::Connect(server, port);