Revision c406626cbfaf8f3f5e035c3cb8c90c21bc8365f5
datallah at pidgin.im
datallah at pidgin.im
Sun Mar 18 19:16:34 EDT 2007
o -----------------------------------------------------------------
| Revision: c406626cbfaf8f3f5e035c3cb8c90c21bc8365f5
| Ancestor: d607a706555960afd49fb83fa0997f3b399151d2
| Author: datallah at pidgin.im
| Date: 2007-03-17T17:47:40
| Branch: im.pidgin.pidgin
|
| Modified files:
| libpurple/dnsquery.c libpurple/dnssrv.c
|
| ChangeLog:
|
| Minor cleanup.
|
| ============================================================
| --- libpurple/dnsquery.c 8407b073a205170e5140c1908471063d8603d6b2
| +++ libpurple/dnsquery.c 6a1e86091b13194c9bb591f9793801b23ad2c256
| @@ -758,7 +758,7 @@ resolve_host(gpointer data)
| {
| char message[1024];
| g_snprintf(message, sizeof(message), _("Thread creation failure: %s"),
| - err ? err->message : _("Unknown reason"));
| + (err && err->message) ? err->message : _("Unknown reason"));
| g_error_free(err);
| gaim_dnsquery_failed(query_data, message);
| }
| ============================================================
| --- libpurple/dnssrv.c 7278cff6e7a0c4991fc0199e472ca0fe8a03a801
| +++ libpurple/dnssrv.c 22b6fe225cb519f86de90d62d8017df534ae0295
| @@ -110,7 +110,7 @@ resolve(int in, int out)
| #ifdef HAVE_SIGNAL_H
| gaim_restore_default_signal_handlers();
| #endif
| -
| +
| if (read(in, query, 256) <= 0)
| _exit(0);
|
| @@ -222,9 +222,9 @@ res_main_thread_cb(gpointer data)
| GaimSrvResponse *srvres_tmp = NULL;
| GSList *lst = query_data->results;
|
| - size = g_slist_length(query_data->results);
| + size = g_slist_length(lst);
|
| - if(query_data->cb)
| + if(query_data->cb && size > 0)
| srvres_tmp = srvres = g_new0(GaimSrvResponse, size);
| while (lst) {
| if(query_data->cb)
| @@ -234,9 +234,9 @@ res_main_thread_cb(gpointer data)
| }
|
| query_data->results = NULL;
| - }
|
| - gaim_debug_info("dnssrv", "found %d SRV entries\n", size);
| + gaim_debug_info("dnssrv", "found %d SRV entries\n", size);
| + }
|
| if(query_data->cb)
| query_data->cb(srvres, size, query_data->extradata);
| @@ -367,29 +367,22 @@ gaim_srv_resolve(const char *protocol, c
| query_data->query = query;
| query_data->extradata = extradata;
|
| - if (!MyDnsQuery_UTF8 || !MyDnsRecordListFree) {
| - query_data->error_message = g_strdup_printf("System missing DNS API (Requires W2K+)\n");
| -
| - /* Asynchronously call the callback since stuff may not expect
| - * the callback to be called before this returns */
| - query_data->handle = g_idle_add(res_main_thread_cb, query_data);
| -
| - return query_data;
| + if (!MyDnsQuery_UTF8 || !MyDnsRecordListFree)
| + query_data->error_message = g_strdup("System missing DNS API (Requires W2K+)\n");
| + else {
| + query_data->resolver = g_thread_create(res_thread, query_data, FALSE, &err);
| + if (query_data->resolver == NULL) {
| + query_data->error_message = g_strdup_printf("SRV thread create failure: %s\n", (err && err->message) ? err->message : "");
| + g_error_free(err);
| + }
| }
|
| - query_data->resolver = g_thread_create(res_thread, query_data, FALSE, &err);
| - if (query_data->resolver == NULL)
| - {
| - query_data->error_message = g_strdup_printf("SRV thread create failure: %s\n", err ? err->message : "");
| - g_error_free(err);
| -
| - /* Asynchronously call the callback since stuff may not expect
| - * the callback to be called before this returns */
| + /* The query isn't going to happen, so finish the SRV lookup now.
| + * Asynchronously call the callback since stuff may not expect
| + * the callback to be called before this returns */
| + if (query_data->error_message != NULL)
| query_data->handle = g_idle_add(res_main_thread_cb, query_data);
|
| - return query_data;
| - }
| -
| return query_data;
| #endif
| }
To get the patch for this revision, please do this:
mtn log --last 1 --diffs --from c406626cbfaf8f3f5e035c3cb8c90c21bc8365f5
More information about the Commits
mailing list