From 6c05781006a9d8a82c3503440588d6b4b5979c4e Mon Sep 17 00:00:00 2001 From: DarkWyrm Date: Mon, 18 Dec 2006 20:14:08 +0000 Subject: [PATCH] This *should* squish the SSL bug which would crash the mail daemon on connection timeouts git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19557 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../mail_daemon/inbound_protocols/pop3/pop3.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp b/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp index 58e5d83cbe..a51d79f13f 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp @@ -54,12 +54,19 @@ POP3Protocol::POP3Protocol(BMessage *settings, BMailChainRunner *status) POP3Protocol::~POP3Protocol() { +#ifdef USESSL + if(use_ssl && ssl) + SendCommand("QUIT" CRLF); +#else SendCommand("QUIT" CRLF); +#endif #ifdef USESSL - if (use_ssl) { - SSL_shutdown(ssl); - SSL_CTX_free(ctx); + if(use_ssl) { + if(ssl) + SSL_shutdown(ssl); + if(ctx) + SSL_CTX_free(ctx); } #endif