# HG changeset patch # User Evan Schoenberg # Date 1139761554 0 # Node ID cdd107258f1128f6bfb7a02747f543a58044f563 # Parent 0d73a901901383824ac2db5990b4026d24ed08dc [gaim-migrate @ 15608] Special handling of disconnection when we were forcibly disconnected is only needed when using OpenSSL, since Mozilla NSS and GnuTLS work fine. I moved the special handling into #ifdef HAVE_OPENSSL blocks and added avoidance of calling gaim_ssl_close() when we were forcibly disconnected since it also causes a crash. Not calling gaim_ssl_close() means that every forced disconnection when using OpenSSL will leak the host name string, since that's released ingaim_ssl_close()... a small leak is prefereable to a crash, but not optimal. committer: Tailor Script diff -r 0d73a9019013 -r cdd107258f11 src/protocols/jabber/jabber.c --- a/src/protocols/jabber/jabber.c Sun Feb 12 16:19:21 2006 +0000 +++ b/src/protocols/jabber/jabber.c Sun Feb 12 16:25:54 2006 +0000 @@ -904,14 +904,23 @@ { JabberStream *js = gc->proto_data; - /* Don't close the stream if we were forcibly disconnected, as our jabber_send_raw() will, - * at best, not go through and will, at worst, crash us. +#ifdef HAVE_OPENSSL + /* If using OpenSSL, don't perform any actions on the ssl connection if we were forcibly disconnected + * because it will crash. */ if (!gc->disconnect_timeout) jabber_send_raw(js, "", -1); +#else + jabber_send_raw(js, "", -1); +#endif if(js->gsc) { - gaim_ssl_close(js->gsc); +#ifdef HAVE_OPENSSL + if (!gc->disconnect_timeout) + gaim_ssl_close(js->gsc); +#else + gaim_ssl_close(js->gsc); +#endif } else if (js->fd > 0) { if(js->gc->inpa) gaim_input_remove(js->gc->inpa);