--- a/src/upnp.c Mon Apr 10 20:31:09 2006 -0400
+++ b/src/upnp.c Tue Apr 11 00:38:50 2006 -0400
@@ -169,11 +169,18 @@
gaim_upnp_compare_device(const xmlnode* device, const gchar* deviceType)
xmlnode* deviceTypeNode = xmlnode_get_child(device, "deviceType");
if(deviceTypeNode == NULL) {
- return !g_ascii_strcasecmp(xmlnode_get_data(deviceTypeNode),
+ tmp = xmlnode_get_data(deviceTypeNode); + ret = !g_ascii_strcasecmp(tmp, deviceType); @@ -181,11 +188,18 @@
gaim_upnp_compare_service(const xmlnode* service, const gchar* serviceType)
xmlnode* serviceTypeNode = xmlnode_get_child(service, "serviceType");
if(serviceTypeNode == NULL) {
- return !g_ascii_strcasecmp(xmlnode_get_data(serviceTypeNode),
+ tmp = xmlnode_get_data(serviceTypeNode); + ret = !g_ascii_strcasecmp(tmp, serviceType); @@ -193,14 +207,9 @@
gaim_upnp_parse_description_response(const gchar* httpResponse, gsize len,
const gchar* httpURL, const gchar* serviceType)
- xmlnode* serviceTypeNode;
- xmlnode* controlURLNode;
+ gchar *xmlRoot, *baseURL, *controlURL, *service; + xmlnode *xmlRootNode, *serviceTypeNode, *controlURLNode, *baseURLNode; /* make sure we have a valid http response */
if(g_strstr_len(httpResponse, len, HTTP_OK) == NULL) {
@@ -226,7 +235,7 @@
/* get the baseURL of the device */
if((baseURLNode = xmlnode_get_child(xmlRootNode, "URLBase")) != NULL) {
- baseURL = g_strdup(xmlnode_get_data(baseURLNode));
+ baseURL = xmlnode_get_data(baseURLNode); baseURL = g_strdup(httpURL);
@@ -328,12 +337,13 @@
- if(!gaim_str_has_prefix(xmlnode_get_data(controlURLNode), "http://") &&
- !gaim_str_has_prefix(xmlnode_get_data(controlURLNode), "HTTP://")) {
- controlURL = g_strdup_printf("%s%s", baseURL,
- xmlnode_get_data(controlURLNode));
+ tmp = xmlnode_get_data(controlURLNode); + if(!gaim_str_has_prefix(tmp, "http://") && + !gaim_str_has_prefix(tmp, "HTTP://")) { + controlURL = g_strdup_printf("%s%s", baseURL, tmp); - controlURL = g_strdup(xmlnode_get_data(controlURLNode));
xmlnode_free(xmlRootNode);