Mercurial > pidgin
changeset 15715:557f37189a96
merge of '1e97f0047cd3e2b4639f29469969dc699089ba1c'
and '6ca4886aaa96a71d75d8db18c3c591cc3312c08f'
author | Evan Schoenberg <evan.s@dreskin.net> |
---|---|
date | Sun, 25 Feb 2007 23:52:12 +0000 |
parents | 4530f15fe5af (diff) a34da2c2d8ba (current diff) |
children | 72a63319582e |
files | |
diffstat | 3 files changed, 46 insertions(+), 41 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/dnsquery.c Sun Feb 25 22:14:24 2007 +0000 +++ b/libpurple/dnsquery.c Sun Feb 25 23:52:12 2007 +0000 @@ -119,13 +119,13 @@ static gboolean gaim_dnsquery_ui_resolve(GaimDnsQueryData *query_data) { - GaimDnsQueryUiOps *ops = gaim_dnsquery_get_ui_ops(); + GaimDnsQueryUiOps *ops = gaim_dnsquery_get_ui_ops(); - if (ops && ops->resolve_host) - { - if (ops->resolve_host(query_data, gaim_dnsquery_resolved, gaim_dnsquery_failed)) - return TRUE; - } + if (ops && ops->resolve_host) + { + if (ops->resolve_host(query_data, gaim_dnsquery_resolved, gaim_dnsquery_failed)) + return TRUE; + } return FALSE; } @@ -390,9 +390,9 @@ /** * @return TRUE if the request was sent succesfully. FALSE - * if the request could not be sent. This isn't - * necessarily an error. If the child has expired, - * for example, we won't be able to send the message. + * if the request could not be sent. This isn't + * necessarily an error. If the child has expired, + * for example, we won't be able to send the message. */ static gboolean send_dns_request_to_child(GaimDnsQueryData *query_data, @@ -471,13 +471,13 @@ query_data = queued_requests->data; queued_requests = g_slist_delete_link(queued_requests, queued_requests); - if (gaim_dnsquery_ui_resolve(query_data)) - { - /* The UI is handling the resolve; we're done */ - handle_next_queued_request(); - return; - } - + if (gaim_dnsquery_ui_resolve(query_data)) + { + /* The UI is handling the resolve; we're done */ + handle_next_queued_request(); + return; + } + /* * If we have any children, attempt to have them perform the DNS * query. If we're able to send the query then resolver will be @@ -601,7 +601,7 @@ GaimDnsQueryData *query_data; g_return_val_if_fail(hostname != NULL, NULL); - g_return_val_if_fail(port != 0, NULL); + g_return_val_if_fail(port != 0, NULL); g_return_val_if_fail(callback != NULL, NULL); query_data = g_new(GaimDnsQueryData, 1); @@ -727,11 +727,11 @@ query_data = data; query_data->timeout = 0; - if (gaim_dnsquery_ui_resolve(query_data)) - { - /* The UI is handling the resolve; we're done */ - return FALSE; - } + if (gaim_dnsquery_ui_resolve(query_data)) + { + /* The UI is handling the resolve; we're done */ + return FALSE; + } if (inet_aton(query_data->hostname, &sin.sin_addr)) { @@ -774,7 +774,7 @@ GaimDnsQueryData *query_data; g_return_val_if_fail(hostname != NULL, NULL); - g_return_val_if_fail(port != 0, NULL); + g_return_val_if_fail(port != 0, NULL); g_return_val_if_fail(callback != NULL, NULL); gaim_debug_info("dnsquery", "Performing DNS lookup for %s\n", hostname); @@ -817,11 +817,11 @@ query_data = data; query_data->timeout = 0; - if (gaim_dnsquery_ui_resolve(query_data)) - { - /* The UI is handling the resolve; we're done */ - return FALSE; - } + if (gaim_dnsquery_ui_resolve(query_data)) + { + /* The UI is handling the resolve; we're done */ + return FALSE; + } if (!inet_aton(query_data->hostname, &sin.sin_addr)) { struct hostent *hp; @@ -854,7 +854,7 @@ GaimDnsQueryData *query_data; g_return_val_if_fail(hostname != NULL, NULL); - g_return_val_if_fail(port != 0, NULL); + g_return_val_if_fail(port != 0, NULL); g_return_val_if_fail(callback != NULL, NULL); query_data = g_new(GaimDnsQueryData, 1); @@ -881,10 +881,10 @@ void gaim_dnsquery_destroy(GaimDnsQueryData *query_data) { - GaimDnsQueryUiOps *ops = gaim_dnsquery_get_ui_ops(); + GaimDnsQueryUiOps *ops = gaim_dnsquery_get_ui_ops(); - if (ops && ops->destroy) - ops->destroy(query_data); + if (ops && ops->destroy) + ops->destroy(query_data); #if defined(__unix__) || defined(__APPLE__) queued_requests = g_slist_remove(queued_requests, query_data); @@ -940,7 +940,7 @@ { g_return_val_if_fail(query_data != NULL, 0); - return query_data->port; + return query_data->port; } void
--- a/libpurple/dnsquery.h Sun Feb 25 22:14:24 2007 +0000 +++ b/libpurple/dnsquery.h Sun Feb 25 23:52:12 2007 +0000 @@ -49,14 +49,14 @@ */ typedef struct { - /* If implemented, the UI is responsible for DNS queries */ - gboolean (*resolve_host)(GaimDnsQueryData *query_data, GaimDnsQueryResolvedCallback resolved_cb, GaimDnsQueryFailedCallback failed_cb); - - /* After destroy is called, query_data will be feed, so this must - * cancel any further use of it the UI would do. Unneeded if - * resolve_host is not implemented. - */ - void (*destroy)(GaimDnsQueryData *query_data); + /* If implemented, the UI is responsible for DNS queries */ + gboolean (*resolve_host)(GaimDnsQueryData *query_data, GaimDnsQueryResolvedCallback resolved_cb, GaimDnsQueryFailedCallback failed_cb); + + /* After destroy is called, query_data will be feed, so this must + * cancel any further use of it the UI would do. Unneeded if + * resolve_host is not implemented. + */ + void (*destroy)(GaimDnsQueryData *query_data); } GaimDnsQueryUiOps; #ifdef __cplusplus
--- a/libpurple/dnssrv.c Sun Feb 25 22:14:24 2007 +0000 +++ b/libpurple/dnssrv.c Sun Feb 25 23:52:12 2007 +0000 @@ -67,6 +67,8 @@ char *query; char *error_message; GSList *results; +#else + pid_t pid; #endif }; @@ -188,6 +190,7 @@ GaimSrvResponse *tmp; int i; GaimSrvCallback cb = query_data->cb; + int status; read(source, &size, sizeof(int)); gaim_debug_info("dnssrv","found %d SRV entries\n", size); @@ -197,6 +200,7 @@ } cb(res, size, query_data->extradata); + waitpid(query_data->pid, &status, 0); gaim_srv_cancel(query_data); } @@ -344,6 +348,7 @@ query_data = g_new0(GaimSrvQueryData, 1); query_data->cb = cb; query_data->extradata = extradata; + query_data->pid = pid; query_data->handle = gaim_input_add(out[0], GAIM_INPUT_READ, resolved, query_data); g_free(query);