summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Aurich <darkrain42@pidgin.im>2009-04-15 01:44:17 +0000
committerPaul Aurich <darkrain42@pidgin.im>2009-04-15 01:44:17 +0000
commit65c7c2c5e32972e08d729ee0c8fa4ad2f83a5f0d (patch)
treee960839e6f816f8099ca9ce56503df3151e702cb
parent164a6a8bc9db99bb431965fa1484d61b01be7895 (diff)
downloadpidgin-65c7c2c5e32972e08d729ee0c8fa4ad2f83a5f0d.tar.gz
Send XMPP keepalive pings to our server, not our bare JID.
jabberd doesn't seem to follow the same semantics for a missing/empty 'to' on a stanza; the response comes from our own full JID. Addressing the pings to the server's JID should sidestep that problem.
-rw-r--r--libpurple/protocols/jabber/jabber.c2
-rw-r--r--libpurple/protocols/jabber/ping.c9
2 files changed, 3 insertions, 8 deletions
diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
index 6c805b3e3b..a681100dcb 100644
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -463,7 +463,7 @@ void jabber_keepalive(PurpleConnection *gc)
JabberStream *js = gc->proto_data;
if (js->keepalive_timeout == -1) {
- jabber_ping_jid(js, NULL);
+ jabber_ping_jid(js, js->user->domain);
js->keepalive_timeout = purple_timeout_add_seconds(120,
(GSourceFunc)(jabber_keepalive_timeout), gc);
}
diff --git a/libpurple/protocols/jabber/ping.c b/libpurple/protocols/jabber/ping.c
index 058f9bcdbd..1e24e5c59e 100644
--- a/libpurple/protocols/jabber/ping.c
+++ b/libpurple/protocols/jabber/ping.c
@@ -55,15 +55,10 @@ static void jabber_ping_result_cb(JabberStream *js, const char *from,
JabberIqType type, const char *id,
xmlnode *packet, gpointer data)
{
- char *own_bare_jid = g_strdup_printf("%s@%s", js->user->node,
- js->user->domain);
-
- if (!from || !strcmp(from, own_bare_jid)) {
- /* If the pong is from our bare JID, treat it as a return from the
+ if (purple_strequal(from, js->user->domain))
+ /* If the pong is from the server, assume it's a result of the
* keepalive functions */
jabber_keepalive_pong_cb(js);
- }
- g_free(own_bare_jid);
if (type == JABBER_IQ_RESULT) {
purple_debug_info("jabber", "PONG!\n");