Mercurial > pidgin
changeset 13242:cdd107258f11
[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 <tailor@pidgin.im>
author | Evan Schoenberg <evan.s@dreskin.net> |
---|---|
date | Sun, 12 Feb 2006 16:25:54 +0000 |
parents | 0d73a9019013 |
children | 70809b5c5f86 |
files | src/protocols/jabber/jabber.c |
diffstat | 1 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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, "</stream:stream>", -1); +#else + jabber_send_raw(js, "</stream:stream>", -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);