diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-12-06 23:19:55 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-12-06 23:19:55 +0000 |
commit | 08e3090aff6e8e63818965cdd490e6616916bf4f (patch) | |
tree | a8f062f9619e639b61538d92852e64f6157f97c8 /src/or/dns.c | |
parent | 249a36586fadbc9bde9b472d1f1faeacf0705683 (diff) | |
download | tor-08e3090aff6e8e63818965cdd490e6616916bf4f.tar tor-08e3090aff6e8e63818965cdd490e6616916bf4f.tar.gz |
More win32 fixes: 1) tolerate extra "readable" events better. 2) when being multithreaded, leave parent fdarray open.
svn:r3092
Diffstat (limited to 'src/or/dns.c')
-rw-r--r-- | src/or/dns.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/dns.c b/src/or/dns.c index 7fb7f6b50..e9f3eb93d 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -581,8 +581,8 @@ int connection_dns_process_inbuf(connection_t *conn) { tor_assert(conn); tor_assert(conn->type == CONN_TYPE_DNSWORKER); - if (conn->state != DNSWORKER_STATE_BUSY) { - log_fn(LOG_WARN,"Bug: poll() indicated than an idle dns worker was readable. Please report."); + if (conn->state != DNSWORKER_STATE_BUSY && buf_datalen(conn->inbuf)) { + log_fn(LOG_WARN,"Bug: read data from an idle dns worker. Please report."); return 0; } if (buf_datalen(conn->inbuf) < 5) /* entire answer available? */ @@ -653,9 +653,9 @@ static int dnsworker_main(void *data) { int fd; int result; - tor_close_socket(fdarray[0]); /* this is the side of the socketpair the parent uses */ fd = fdarray[1]; /* this side is ours */ #ifndef MS_WINDOWS + tor_close_socket(fdarray[0]); /* this is the side of the socketpair the parent uses */ connection_free_all(); /* so the child doesn't hold the parent's fd's open */ #endif handle_signals(0); /* ignore interrupts from the keyboard, etc */ |