[or-cvs] [tor/maint-0.2.1] Use tor_socket_strerror in eventdns.c. Fixes bug 987.

Nick Mathewson nickm at seul.org
Mon May 25 20:39:53 UTC 2009


Author: Nick Mathewson <nickm at torproject.org>
Date: Mon, 25 May 2009 16:38:50 -0400
Subject: Use tor_socket_strerror in eventdns.c. Fixes bug 987.
Commit: 99c315a473bdeb25680d07f7aaca089a6c1f8ecb

---
 ChangeLog         |    6 ++++++
 src/or/eventdns.c |    8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dafdf27..2de570d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Changes in version 0.2.1.16-?? - 2009-??-??
+  o Minor bugfixes (on 0.2.0.x):
+    - Log correct error messages for DNS-related network errors on
+      Windows.
+
+
 Changes in version 0.2.1.15-rc - 2009-05-25
   o Major bugfixes (on 0.2.0.x):
     - Fix a timing-dependent, allocator-dependent, DNS-related crash bug
diff --git a/src/or/eventdns.c b/src/or/eventdns.c
index cd13303..4464148 100644
--- a/src/or/eventdns.c
+++ b/src/or/eventdns.c
@@ -1299,7 +1299,7 @@ nameserver_read(struct nameserver *ns) {
 		if (r < 0) {
 			int err = last_error(ns->socket);
 			if (error_is_eagain(err)) return;
-			nameserver_failed(ns, strerror(err));
+			nameserver_failed(ns, tor_socket_strerror(err));
 			return;
 		}
 		/* XXX Match port too? */
@@ -1331,7 +1331,7 @@ server_port_read(struct evdns_server_port *s) {
 			int err = last_error(s->socket);
 			if (error_is_eagain(err)) return;
 			log(EVDNS_LOG_WARN, "Error %s (%d) while reading request.",
-				strerror(err), err);
+				tor_socket_strerror(err), err);
 			return;
 		}
 		request_parse(packet, r, s, (struct sockaddr*) &addr, addrlen);
@@ -1350,7 +1350,7 @@ server_port_flush(struct evdns_server_port *port)
 			int err = last_error(port->socket);
 			if (error_is_eagain(err))
 				return;
-			log(EVDNS_LOG_WARN, "Error %s (%d) while writing response to port; dropping", strerror(err), err);
+			log(EVDNS_LOG_WARN, "Error %s (%d) while writing response to port; dropping", tor_socket_strerror(err), err);
 		}
 		if (server_request_free(req)) {
 			/* we released the last reference to req->port. */
@@ -2063,7 +2063,7 @@ evdns_request_transmit_to(struct evdns_request *req, struct nameserver *server)
 	if (r < 0) {
 		int err = last_error(server->socket);
 		if (error_is_eagain(err)) return 1;
-		nameserver_failed(req->ns, strerror(err));
+		nameserver_failed(req->ns, tor_socket_strerror(err));
 		return 2;
 	} else if (r != (ssize_t)req->request_len) {
 		return 1;  /* short write */
-- 
1.5.6.5



More information about the tor-commits mailing list