Mercurial > pidgin.yaz
changeset 28848:4370819b97ff
dns: I don't think this worked correctly before.
Closing child_out and then continuing means that this DNS child would
hang around but have no means of communicating to the parent. I added
one of these, but the second has existed since the DNS forking
was introduced way back in fb8fbdd2118703058de16589570503043bc588fd.
Instead, let's take the safe route and just kill off the child in these
circumstances.
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sun, 01 Nov 2009 00:12:38 +0000 |
parents | 1c6c53143afe |
children | fb1f8b2ae9e1 |
files | libpurple/dnsquery.c |
diffstat | 1 files changed, 2 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/dnsquery.c Sat Oct 31 22:25:22 2009 +0000 +++ b/libpurple/dnsquery.c Sun Nov 01 00:12:38 2009 +0000 @@ -295,12 +295,11 @@ rc = purple_network_convert_idn_to_ascii(dns_params.hostname, &hostname); if (rc != 0) { write_to_parent(child_out, &rc, sizeof(rc)); - close(child_out); if (show_debug) fprintf(stderr, "dns[%d] Error: IDN conversion returned " "%d\n", getpid(), rc); dns_params.hostname[0] = '\0'; - continue; + break; } } else /* intentional to execute the g_strdup */ #endif @@ -325,14 +324,13 @@ rc = getaddrinfo(hostname, servname, &hints, &res); write_to_parent(child_out, &rc, sizeof(rc)); if (rc != 0) { - close(child_out); if (show_debug) printf("dns[%d] Error: getaddrinfo returned %d\n", getpid(), rc); dns_params.hostname[0] = '\0'; g_free(hostname); hostname = NULL; - continue; + break; } tmp = res; while (res) {