diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-01-19 21:34:42 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-01-19 21:34:42 +0000 |
commit | e0bf5976658ea76cd8b61d67f957b3c4f68e9108 (patch) | |
tree | fa32e3a61309b2691e2ecb3cff2c69df5ab20a53 /src/or/dns.c | |
parent | 75d83827e0374252bd5c91cbfa0b67e36ad70741 (diff) | |
download | tor-e0bf5976658ea76cd8b61d67f957b3c4f68e9108.tar.gz tor-e0bf5976658ea76cd8b61d67f957b3c4f68e9108.zip |
Give more useful log messages when the tor process closes dns/cpuworker connections. "Error: Success!" makes us seem like crazy people."
svn:r3373
Diffstat (limited to 'src/or/dns.c')
-rw-r--r-- | src/or/dns.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/or/dns.c b/src/or/dns.c index e70b277c36..dfa6876d91 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -673,10 +673,15 @@ static int dnsworker_main(void *data) { tor_free(data); for (;;) { + int r; - if (recv(fd, &address_len, 1, 0) != 1) { - log_fn(LOG_INFO,"dnsworker exiting because tor process closed connection (either pruned idle dnsworker or died)."); - log_fn(LOG_INFO,"Error on %d was %s", fd, tor_socket_strerror(tor_socket_errno(fd))); + if ((r = recv(fd, &address_len, 1, 0)) != 1) { + if (r == 0) { + log_fn(LOG_INFO,"DNS worker exiting because Tor process closed connection (either pruned idle dnsworker or died)."); + } else { + log_fn(LOG_INFO,"DNS worker exiting because of error on connection to Tor process."); + log_fn(LOG_INFO,"(Error on %d was %s)", fd, tor_socket_strerror(tor_socket_errno(fd))); + } spawn_exit(); } |