changeset 14000:f327a27f7f07

[gaim-migrate @ 16585] A fix for the nasty libxml corruption crash in jabber, from Henning Norn. committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Thu, 27 Jul 2006 18:58:14 +0000
parents dd19c67be844
children 66d01a547603
files COPYRIGHT src/protocols/jabber/jabber.c src/protocols/jabber/jabber.h
diffstat 3 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Thu Jul 27 18:35:16 2006 +0000
+++ b/COPYRIGHT	Thu Jul 27 18:58:14 2006 +0000
@@ -195,6 +195,7 @@
 Richard Nelson
 Dennis Nezic
 Matthew A. Nicholson
+Henning Norén
 Szilard Novaki
 Novell
 Padraig O'Briain
--- a/src/protocols/jabber/jabber.c	Thu Jul 27 18:35:16 2006 +0000
+++ b/src/protocols/jabber/jabber.c	Thu Jul 27 18:58:14 2006 +0000
@@ -66,6 +66,7 @@
 	/* setup the parser fresh for each stream */
 	jabber_parser_setup(js);
 	jabber_send_raw(js, open_stream, -1);
+	js->reinit = FALSE;
 	g_free(open_stream);
 }
 
@@ -354,6 +355,8 @@
 		buf[len] = '\0';
 		gaim_debug(GAIM_DEBUG_INFO, "jabber", "Recv (ssl)(%d): %s\n", len, buf);
 		jabber_parser_process(js, buf, len);
+		if(js->reinit)
+			jabber_stream_init(js);
 	}
 
 	if(errno == EAGAIN)
@@ -1009,7 +1012,7 @@
 		case JABBER_STREAM_REINITIALIZING:
 			gaim_connection_update_progress(js->gc, _("Re-initializing Stream"),
 					6, JABBER_CONNECT_STEPS);
-			jabber_stream_init(js);
+			js->reinit = TRUE;
 			break;
 		case JABBER_STREAM_CONNECTED:
 			jabber_roster_request(js);
--- a/src/protocols/jabber/jabber.h	Thu Jul 27 18:35:16 2006 +0000
+++ b/src/protocols/jabber/jabber.h	Thu Jul 27 18:58:14 2006 +0000
@@ -121,6 +121,8 @@
 	GaimCircBuffer *write_buffer;
 	guint writeh;
 
+	gboolean reinit;
+
 	/* OK, this stays at the end of the struct, so plugins can depend
 	 * on the rest of the stuff being in the right place
 	 */