changeset 32311:c2dcb6d3b246

Jabber: Move the "inpa" input watcher into protocol_data.
author andrew.victor@mxit.com
date Tue, 18 Oct 2011 21:20:56 +0000
parents 6135b24cdc8a
children f236f3fce0d8
files libpurple/protocols/jabber/jabber.c libpurple/protocols/jabber/jabber.h
diffstat 2 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Tue Oct 18 21:17:08 2011 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Tue Oct 18 21:20:56 2011 +0000
@@ -829,7 +829,7 @@
 		jabber_send_raw(js, "<?xml version='1.0' ?>", -1);
 
 	jabber_stream_set_state(js, JABBER_STREAM_INITIALIZING);
-	gc->inpa = purple_input_add(js->fd, PURPLE_INPUT_READ, jabber_recv_cb, gc);
+	js->inpa = purple_input_add(js->fd, PURPLE_INPUT_READ, jabber_recv_cb, gc);
 }
 
 static void
@@ -850,8 +850,8 @@
 
 static void tls_init(JabberStream *js)
 {
-	purple_input_remove(js->gc->inpa);
-	js->gc->inpa = 0;
+	purple_input_remove(js->inpa);
+	js->inpa = 0;
 	js->gsc = purple_ssl_connect_with_host_fd(purple_connection_get_account(js->gc), js->fd,
 			jabber_login_callback_ssl, jabber_ssl_connect_failure, js->certificate_CN, js->gc);
 	/* The fd is no longer our concern */
@@ -1603,8 +1603,10 @@
 	if(js->gsc) {
 		purple_ssl_close(js->gsc);
 	} else if (js->fd > 0) {
-		if(js->gc->inpa)
-			purple_input_remove(js->gc->inpa);
+		if(js->inpa) {
+			purple_input_remove(js->inpa);
+			js->inpa = 0;
+		}
 		close(js->fd);
 	}
 
--- a/libpurple/protocols/jabber/jabber.h	Tue Oct 18 21:17:08 2011 +0000
+++ b/libpurple/protocols/jabber/jabber.h	Tue Oct 18 21:20:56 2011 +0000
@@ -99,6 +99,7 @@
 struct _JabberStream
 {
 	int fd;
+	guint inpa;
 
 	PurpleSrvTxtQueryData *srv_query_data;