diff libgaim/proxy.c @ 14238:f189327b9968

[gaim-migrate @ 16920] Cancelable DNS queries. This eliminates crashes when you cancel a connection attempt while we're waiting for a response from a DNS server. I tested with all three methods, so they SHOULD be ok. Let me know if you have problems. I should be around today, starting in maybe an hour. I feel like it's kinda dumb for us to have three implementations for the same thing. I want to get rid of the child-process method (currently used in Unix and OS-X) and use the thread-based method (currently used in Windows) everywhere. Then we can get rid of the third method, too (currently used when !Unix and !OS-X and !Windows) Any objections? committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 20 Aug 2006 22:24:13 +0000
parents 60b1bc8dbf37
children baff095b146c
line wrap: on
line diff
--- a/libgaim/proxy.c	Sun Aug 20 22:16:13 2006 +0000
+++ b/libgaim/proxy.c	Sun Aug 20 22:24:13 2006 +0000
@@ -309,6 +309,9 @@
 
 	connect_infos = g_slist_remove(connect_infos, connect_info);
 
+	if (connect_info->query_data != NULL)
+		gaim_dnsquery_destroy(connect_info->query_data);
+
 	while (connect_info->hosts != NULL)
 	{
 		/* Discard the length... */
@@ -1571,13 +1574,18 @@
 {
 	GaimProxyConnectInfo *connect_info;
 
+	connect_info = data;
+	connect_info->query_data = NULL;
+
 	if (error_message != NULL)
 	{
-		gaim_debug_info("proxy", "Error while resolving hostname: %s\n", error_message);
-		/* TODO: Destroy connect_info and return? */
+		gchar *tmp;
+		tmp = g_strdup_printf("Error while resolving hostname: %s\n", error_message);
+		gaim_proxy_connect_info_error(connect_info, tmp);
+		g_free(tmp);
+		return;
 	}
 
-	connect_info = data;
 	connect_info->hosts = hosts;
 
 	try_connect(connect_info);
@@ -1821,10 +1829,6 @@
 		proxy_pref_cb, NULL);
 	gaim_prefs_connect_callback(handle, "/core/proxy/password",
 		proxy_pref_cb, NULL);
-#ifdef _WIN32
-	if(!g_thread_supported())
-		g_thread_init(NULL);
-#endif
 }
 
 void