changeset 27069:08f5c5b12e7c

The XMPP keepalive timeout handle needs to be a guint. This probably isn't the issue of Adium#12351, but is more correct.
author Paul Aurich <paul@darkrain42.org>
date Sun, 07 Jun 2009 17:02:23 +0000
parents faed0a042558
children d570d1e10382
files libpurple/protocols/jabber/jabber.c libpurple/protocols/jabber/jabber.h libpurple/protocols/jabber/ping.c
diffstat 3 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Sun Jun 07 08:13:14 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Sun Jun 07 17:02:23 2009 +0000
@@ -474,7 +474,7 @@
 	JabberStream *js = gc->proto_data;
 	purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 					_("Ping timeout"));
-	js->keepalive_timeout = -1;
+	js->keepalive_timeout = 0;
 	return FALSE;
 }
 
@@ -482,7 +482,7 @@
 {
 	JabberStream *js = gc->proto_data;
 
-	if (js->keepalive_timeout == -1) {
+	if (js->keepalive_timeout == 0) {
 		jabber_keepalive_ping(js);
 		js->keepalive_timeout = purple_timeout_add_seconds(120,
 				(GSourceFunc)(jabber_keepalive_timeout), gc);
@@ -778,7 +778,7 @@
 	js->next_id = g_random_int();
 	js->write_buffer = purple_circ_buffer_new(512);
 	js->old_length = 0;
-	js->keepalive_timeout = -1;
+	js->keepalive_timeout = 0;
 	/* Set the default protocol version to 1.0. Overridden in parser.c. */
 	js->protocol_version = JABBER_PROTO_1_0;
 	js->sessions = NULL;
@@ -1295,7 +1295,7 @@
 	js->user = jabber_id_new(purple_account_get_username(account));
 	js->next_id = g_random_int();
 	js->old_length = 0;
-	js->keepalive_timeout = -1;
+	js->keepalive_timeout = 0;
 
 	if(!js->user) {
 		purple_connection_error_reason (gc,
@@ -1548,7 +1548,7 @@
 	g_free(js->old_track);
 	g_free(js->expected_rspauth);
 
-	if (js->keepalive_timeout != -1)
+	if (js->keepalive_timeout != 0)
 		purple_timeout_remove(js->keepalive_timeout);
 
 	g_free(js->srv_rec);
--- a/libpurple/protocols/jabber/jabber.h	Sun Jun 07 08:13:14 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.h	Sun Jun 07 17:02:23 2009 +0000
@@ -245,7 +245,7 @@
 	char *certificate_CN;
 
 	/* A purple timeout tag for the keepalive */
-	int keepalive_timeout;
+	guint keepalive_timeout;
 
 	PurpleSrvResponse *srv_rec;
 	guint srv_rec_idx;
--- a/libpurple/protocols/jabber/ping.c	Sun Jun 07 08:13:14 2009 +0000
+++ b/libpurple/protocols/jabber/ping.c	Sun Jun 07 17:02:23 2009 +0000
@@ -32,9 +32,9 @@
                                      JabberIqType type, const char *id,
                                      xmlnode *packet, gpointer data)
 {
-	if (js->keepalive_timeout >= 0) {
+	if (js->keepalive_timeout != 0) {
 		purple_timeout_remove(js->keepalive_timeout);
-		js->keepalive_timeout = -1;
+		js->keepalive_timeout = 0;
 	}
 }