We should be using the type listed in the response, not in the

Tue, 02 Feb 2010 20:42:00 +0000

author
Mark Doliner <markdoliner@pidgin.im>
date
Tue, 02 Feb 2010 20:42:00 +0000
changeset 29253
4621bf356c67
parent 29252
0fa50eacbcb3
child 29254
49bb9cb05e38

We should be using the type listed in the response, not in the
query. Because who knows what the server is going to respond
with? I noticed this when trying to connect to an XMPP account
on jabber.linuxlovers.at. They return a CNAME when querying for
SRV--I don't know if that's actually valid.

$ dig srv _xmpp-client._tcp.jabber.linuxlovers.at

;; ANSWER SECTION:
_xmpp-client._tcp.jabber.linuxlovers.at. 85361 IN CNAME jabber.linuxlovers.at.

libpurple/dnssrv.c file | annotate | diff | comparison | revisions
--- a/libpurple/dnssrv.c	Mon Feb 01 22:00:26 2010 +0000
+++ b/libpurple/dnssrv.c	Tue Feb 02 20:42:00 2010 +0000
@@ -366,7 +366,7 @@
 		cp += 6;
 
 		GETSHORT(dlen,cp);
-		if (query.type == T_SRV) {
+		if (type == T_SRV) {
 			GETSHORT(pref,cp);
 
 			GETSHORT(weight,cp);
@@ -386,7 +386,7 @@
 			srvres->weight = weight;
 
 			ret = g_list_prepend(ret, srvres);
-		} else if (query.type == T_TXT) {
+		} else if (type == T_TXT) {
 			txtres = g_new0(PurpleTxtResponse, 1);
 			txtres->content = g_strndup((gchar*)(++cp), dlen-1);
 			ret = g_list_append(ret, txtres);

mercurial