diff src/dnssrv.c @ 12691:4e1d44bad3c4

[gaim-migrate @ 15034] Using g_thread_exit() instead of simply returning at the bottom of the thread function seems to prevent some weird crashes. Also, display the error message for SRV lookup failures instead of just the error code. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Tue, 03 Jan 2006 05:56:22 +0000
parents 5f65a0cca87c
children a95094ac6766
line wrap: on
line diff
--- a/src/dnssrv.c	Tue Jan 03 05:23:01 2006 +0000
+++ b/src/dnssrv.c	Tue Jan 03 05:56:22 2006 +0000
@@ -234,7 +234,9 @@
 
 	ds = MyDnsQuery_UTF8(rdata->query, type, DNS_QUERY_STANDARD, NULL, &dr, NULL);
 	if (ds != ERROR_SUCCESS) {
-		rdata->errmsg = g_strdup_printf("Couldn't look up SRV record. Error = %d\n", (int) ds);
+		gchar *msg = g_win32_error_message(ds);
+		rdata->errmsg = g_strdup_printf("Couldn't look up SRV record. %s (%lu).\n", msg, ds);
+		g_free(msg);
 	} else {
 		PDNS_RECORD dr_tmp;
 		GSList *lst = NULL;
@@ -265,7 +267,8 @@
 	/* back to main thread */
 	g_idle_add(res_main_thread_cb, rdata);
 
-	return 0;
+	g_thread_exit(NULL);
+	return NULL;
 }
 
 #endif