comparison src/upnp.c @ 13096:ef1b5208bda9

[gaim-migrate @ 15458] Use gaim_str_has_prefix() to cleanup some code. I noticed the hardcoding of SIZEOF_HTTP and that seemed wrong. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Thu, 02 Feb 2006 18:44:29 +0000
parents 8e3b85fe4a55
children 33bef17125c2
comparison
equal deleted inserted replaced
13095:5a7c4570d768 13096:ef1b5208bda9
37 /*************************************************************** 37 /***************************************************************
38 ** General Defines * 38 ** General Defines *
39 ****************************************************************/ 39 ****************************************************************/
40 #define HTTP_OK "200 OK" 40 #define HTTP_OK "200 OK"
41 #define DEFAULT_HTTP_PORT 80 41 #define DEFAULT_HTTP_PORT 80
42 #define SIZEOF_HTTP 7 /* size of "http://" string */
43 #define DISCOVERY_TIMEOUT 1000 42 #define DISCOVERY_TIMEOUT 1000
44 43
45 /*************************************************************** 44 /***************************************************************
46 ** Discovery/Description Defines * 45 ** Discovery/Description Defines *
47 ****************************************************************/ 46 ****************************************************************/
327 g_free(baseURL); 326 g_free(baseURL);
328 xmlnode_free(xmlRootNode); 327 xmlnode_free(xmlRootNode);
329 return NULL; 328 return NULL;
330 } 329 }
331 330
332 if(g_strstr_len(xmlnode_get_data(controlURLNode), 331 if(!gaim_str_has_prefix(xmlnode_get_data(controlURLNode), "http://") &&
333 SIZEOF_HTTP, "http://") == NULL && 332 !gaim_str_has_prefix(xmlnode_get_data(controlURLNode), "HTTP://")) {
334 g_strstr_len(xmlnode_get_data(controlURLNode),
335 SIZEOF_HTTP, "HTTP://") == NULL) {
336 controlURL = g_strdup_printf("%s%s", baseURL, 333 controlURL = g_strdup_printf("%s%s", baseURL,
337 xmlnode_get_data(controlURLNode)); 334 xmlnode_get_data(controlURLNode));
338 }else{ 335 }else{
339 controlURL = g_strdup(xmlnode_get_data(controlURLNode)); 336 controlURL = g_strdup(xmlnode_get_data(controlURLNode));
340 } 337 }