diff src/upnp.c @ 13200:33bef17125c2

[gaim-migrate @ 15563] This is the soon-to-be-infamous nonblocking network activity patch that I've been working on. Feel free to yell at me if this makes you unhappy. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 09 Feb 2006 04:17:56 +0000
parents ef1b5208bda9
children 095fd5936962
line wrap: on
line diff
--- a/src/upnp.c	Thu Feb 09 04:14:54 2006 +0000
+++ b/src/upnp.c	Thu Feb 09 04:17:56 2006 +0000
@@ -408,6 +408,7 @@
 
 	dd->full_url = g_strdup_printf("http://%s:%d",
 			descriptionAddress, port);
+	g_free(descriptionAddress);
 
 	/* Remove the timeout because everything it is waiting for has
 	 * successfully completed */
@@ -417,7 +418,6 @@
 	gaim_url_fetch_request(descriptionURL, TRUE, NULL, TRUE, httpRequest,
 			TRUE, upnp_parse_description_cb, dd);
 
-	g_free(descriptionAddress);
 	g_free(httpRequest);
 
 }
@@ -543,7 +543,7 @@
 	   we should retry the send NUM_UDP_ATTEMPTS times. Also,
 	   try different requests for WANIPConnection and WANPPPConnection*/
 	for(; dd->retry_count < NUM_UDP_ATTEMPTS; dd->retry_count++) {
-		sentSuccess = TRUE;
+		sentSuccess = FALSE;
 
 		if((dd->retry_count % 2) == 0) {
 			strncpy(dd->service_type, WAN_IP_CONN_SERVICE, sizeof(dd->service_type));
@@ -563,7 +563,7 @@
 				sentSuccess = TRUE;
 				break;
 			}
-		} while (errno == EINTR);
+		} while (errno == EINTR || errno == EAGAIN);
 
 		g_free(sendMessage);