summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Doliner <markdoliner@pidgin.im>2008-09-10 21:48:33 +0000
committerMark Doliner <markdoliner@pidgin.im>2008-09-10 21:48:33 +0000
commita8166c59efe0d5375b9a652c6f1e97cc49a25d24 (patch)
tree25b7540aaf8b60976935645d1d283cb35736cc5e
parentfb9a5adb98582583eadb55cc2864bf6524785c20 (diff)
downloadpidgin-a8166c59efe0d5375b9a652c6f1e97cc49a25d24.tar.gz
In our child DNS lookup processes, don't bother to use select to watch
the pipe with our parent. These processes don't do anything else, and they only need to watch one fd, so we can just use a blocking read() call. I don't think this will negatively affect anything, and it seems to fix some kind of funky rare race condition where the libpurple client will block while trying to read() a response from the child. If you think we should continue using select here, or you notice some problems with this, please let me know (and maybe even revert this)
-rw-r--r--libpurple/dnsquery.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/libpurple/dnsquery.c b/libpurple/dnsquery.c
index 3770b3cc22..a43230e2fb 100644
--- a/libpurple/dnsquery.c
+++ b/libpurple/dnsquery.c
@@ -209,16 +209,6 @@ purple_dnsquery_resolver_run(int child_out, int child_in, gboolean show_debug)
* the result back to our parent, when finished.
*/
while (1) {
- fd_set fds;
- struct timeval tv = { .tv_sec = 40 , .tv_usec = 0 };
- FD_ZERO(&fds);
- FD_SET(child_in, &fds);
- rc = select(child_in + 1, &fds, NULL, NULL, &tv);
- if (!rc) {
- if (show_debug)
- printf("dns[%d]: nobody needs me... =(\n", getpid());
- break;
- }
rc = read(child_in, &dns_params, sizeof(dns_params_t));
if (rc < 0) {
fprintf(stderr, "dns[%d]: Error: Could not read dns_params: "