[gaim-migrate @ 15034]

Tue, 03 Jan 2006 05:56:22 +0000

author
Daniel Atallah <datallah@pidgin.im>
date
Tue, 03 Jan 2006 05:56:22 +0000
changeset 12691
4c178bccdba7
parent 12690
4a93889c7593
child 12692
249f9d844f6f

[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.

src/dnssrv.c file | annotate | diff | comparison | revisions
--- 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

mercurial