comparison 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
comparison
equal deleted inserted replaced
12690:d03afaccd41c 12691:4e1d44bad3c4
232 DNS_STATUS ds; 232 DNS_STATUS ds;
233 struct resdata *rdata = data; 233 struct resdata *rdata = data;
234 234
235 ds = MyDnsQuery_UTF8(rdata->query, type, DNS_QUERY_STANDARD, NULL, &dr, NULL); 235 ds = MyDnsQuery_UTF8(rdata->query, type, DNS_QUERY_STANDARD, NULL, &dr, NULL);
236 if (ds != ERROR_SUCCESS) { 236 if (ds != ERROR_SUCCESS) {
237 rdata->errmsg = g_strdup_printf("Couldn't look up SRV record. Error = %d\n", (int) ds); 237 gchar *msg = g_win32_error_message(ds);
238 rdata->errmsg = g_strdup_printf("Couldn't look up SRV record. %s (%lu).\n", msg, ds);
239 g_free(msg);
238 } else { 240 } else {
239 PDNS_RECORD dr_tmp; 241 PDNS_RECORD dr_tmp;
240 GSList *lst = NULL; 242 GSList *lst = NULL;
241 DNS_SRV_DATA *srv_data; 243 DNS_SRV_DATA *srv_data;
242 GaimSrvResponse *srvres; 244 GaimSrvResponse *srvres;
263 } 265 }
264 266
265 /* back to main thread */ 267 /* back to main thread */
266 g_idle_add(res_main_thread_cb, rdata); 268 g_idle_add(res_main_thread_cb, rdata);
267 269
268 return 0; 270 g_thread_exit(NULL);
271 return NULL;
269 } 272 }
270 273
271 #endif 274 #endif
272 275
273 void gaim_srv_resolve(const char *protocol, const char *transport, const char *domain, GaimSRVCallback cb, gpointer extradata) { 276 void gaim_srv_resolve(const char *protocol, const char *transport, const char *domain, GaimSRVCallback cb, gpointer extradata) {