[or-cvs] make dns resolves a lot faster

Roger Dingledine arma at seul.org
Sun Mar 28 21:16:54 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	dns.c 
Log Message:
make dns resolves a lot faster
(but only enable this once we've found the bug)


Index: dns.c
===================================================================
RCS file: /home/or/cvsroot/src/or/dns.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- dns.c	28 Mar 2004 04:54:36 -0000	1.69
+++ dns.c	28 Mar 2004 21:16:52 -0000	1.70
@@ -109,11 +109,21 @@
   struct cached_resolve *resolve;
   struct cached_resolve search;
   struct pending_connection_t *pending_connection;
+  struct in_addr in;
   uint32_t now = time(NULL);
   assert_connection_ok(exitconn, 0);
 
-  /* first take this opportunity to see if there are any expired
-     resolves in the tree.*/
+#if 0 /* only enable this once we've found the conn-munging bug */
+  /* first check if exitconn->address is an IP. If so, we already
+   * know the answer. */
+  if (tor_inet_aton(exitconn->address, &in) != 0) {
+    exitconn->addr = ntohl(in.s_addr);
+    return 1;
+  }
+#endif
+
+  /* then take this opportunity to see if there are any expired
+   * resolves in the tree. */
   purge_expired_resolves(now);
 
   /* now check the tree to see if 'address' is already there. */



More information about the tor-commits mailing list