changeset 29321:55cda40d5cf4

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.
author Mark Doliner <mark@kingant.net>
date Tue, 02 Feb 2010 20:42:00 +0000
parents 508b73ce9b14
children 816e9b5f3310
files libpurple/dnssrv.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);