Mercurial > pidgin
changeset 22459:8ec6ac1b9e26
Only allow one keepalive_timeout at a time. This prevents us from starting a
second one and therefore losing track of the first when the server isn't
responding within the 120 second timeout interval. Refs #4814; really shouldn't
fix it, but it might.
author | Evan Schoenberg <evan.s@dreskin.net> |
---|---|
date | Tue, 11 Mar 2008 22:58:36 +0000 |
parents | b53bacc6eb6e |
children | 4baa8b7ad5b4 |
files | libpurple/protocols/jabber/jabber.c |
diffstat | 1 files changed, 10 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c Sun Mar 09 18:47:09 2008 +0000 +++ b/libpurple/protocols/jabber/jabber.c Tue Mar 11 22:58:36 2008 +0000 @@ -406,14 +406,17 @@ void jabber_keepalive(PurpleConnection *gc) { JabberStream *js = gc->proto_data; - JabberIq *iq = jabber_iq_new(js, JABBER_IQ_GET); - xmlnode *ping = xmlnode_new_child(iq->node, "ping"); - xmlnode_set_namespace(ping, "urn:xmpp:ping"); - - js->keepalive_timeout = purple_timeout_add_seconds(120, (GSourceFunc)(jabber_pong_timeout), gc); - jabber_iq_set_callback(iq, jabber_pong_cb, GINT_TO_POINTER(js->keepalive_timeout)); - jabber_iq_send(iq); + if (js->keepalive_timeout == -1) { + JabberIq *iq = jabber_iq_new(js, JABBER_IQ_GET); + + xmlnode *ping = xmlnode_new_child(iq->node, "ping"); + xmlnode_set_namespace(ping, "urn:xmpp:ping"); + + js->keepalive_timeout = purple_timeout_add_seconds(120, (GSourceFunc)(jabber_pong_timeout), gc); + jabber_iq_set_callback(iq, jabber_pong_cb, GINT_TO_POINTER(js->keepalive_timeout)); + jabber_iq_send(iq); + } } static void