[or-cvs] r18494: {tor} Revert an erroneous part of the non-fix to bug 326, and add (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Wed Feb 11 17:23:27 UTC 2009


Author: nickm
Date: 2009-02-11 12:23:11 -0500 (Wed, 11 Feb 2009)
New Revision: 18494

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/eventdns.c
Log:
Revert an erroneous part of the non-fix to bug 326, and add comments to explain why it was erroneous.

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2009-02-11 17:22:34 UTC (rev 18493)
+++ tor/trunk/ChangeLog	2009-02-11 17:23:11 UTC (rev 18494)
@@ -16,6 +16,9 @@
       logs. Bugfix on 0.2.1.8-alpha.
     - Clients no longer cache certificates for authorities they do not
       recognize.  Bugfix on 0.2.0.9-alpha.
+    - When we can't transmit a DNS request due to a network error, retry
+      it after a while, and eventually transmit a failing response to the
+      RESOLVED cell.  Bugfix on 0.1.2.5-alpha.
 
   o Minor features:
     - On Linux, use the prctl call to re-enable core dumps when the user

Modified: tor/trunk/src/or/eventdns.c
===================================================================
--- tor/trunk/src/or/eventdns.c	2009-02-11 17:22:34 UTC (rev 18493)
+++ tor/trunk/src/or/eventdns.c	2009-02-11 17:23:11 UTC (rev 18494)
@@ -2046,9 +2046,10 @@
 		nameserver_write_waiting(req->ns, 1);
 		return 1;
 	case 2:
-		/* failed in some other way */
+		/* failed to transmit the request entirely. */
 		retcode = 1;
-		break;
+		/* fall through: we'll set a timeout, which will time out,
+		 * and make us retransmit the request anyway. */
 	default:
 		/* transmitted; we need to check for timeout. */
 		log(EVDNS_LOG_DEBUG,
@@ -2060,11 +2061,10 @@
 				(unsigned long) req);
 			/* ???? Do more? */
 		}
+		req->tx_count++;
+		req->transmit_me = 0;
+		return retcode;
 	}
-
-	req->tx_count++;
-	req->transmit_me = 0;
-	return retcode;
 }
 
 static void



More information about the tor-commits mailing list