[or-cvs] Oops. When we dont get a TTL, we should default to the defa...

Nick Mathewson nickm at seul.org
Sat Jun 3 21:47:28 UTC 2006


Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv31385/src/or

Modified Files:
	connection_edge.c 
Log Message:
Oops. When we dont get a TTL, we should default to the default, not to the minimum.

Index: connection_edge.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/connection_edge.c,v
retrieving revision 1.399
retrieving revision 1.400
diff -u -p -d -r1.399 -r1.400
--- connection_edge.c	3 Jun 2006 21:41:14 -0000	1.399
+++ connection_edge.c	3 Jun 2006 21:47:26 -0000	1.400
@@ -711,7 +711,7 @@ client_dns_clear_failures(const char *ad
  * ".exitname.exit" before registering the mapping.
  *
  * If <b>ttl</b> is nonnegative, the mapping will be valid for
- * <b>ttl</b>seconds.
+ * <b>ttl</b>seconds; otherwise, we use the default.
  */
 void
 client_dns_set_addressmap(const char *address, uint32_t val,
@@ -728,7 +728,10 @@ client_dns_set_addressmap(const char *ad
   tor_assert(address);
   tor_assert(val);
 
-  ttl = dns_clip_ttl(ttl);
+  if (ttl<0)
+    ttl = DEFAULT_DNS_TTL;
+  else
+    ttl = dns_clip_ttl(ttl);
 
   if (tor_inet_aton(address, &in))
     return; /* If address was an IP address already, don't add a mapping. */



More information about the tor-commits mailing list