aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-06-03 21:47:26 +0000
committerNick Mathewson <nickm@torproject.org>2006-06-03 21:47:26 +0000
commit2700e5a1abb6937abaeda08d343c60a25b053df3 (patch)
treee65e80f64967ecc488d6ca7c56d3d858cce29c59 /src
parentc660a0f6a2875a8b9b612f28a7f752b3ca8eb5da (diff)
downloadtor-2700e5a1abb6937abaeda08d343c60a25b053df3.tar
tor-2700e5a1abb6937abaeda08d343c60a25b053df3.tar.gz
Oops. When we dont get a TTL, we should default to the default, not to the minimum.
svn:r6527
Diffstat (limited to 'src')
-rw-r--r--src/or/connection_edge.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 78991185b..8950137c2 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -711,7 +711,7 @@ client_dns_clear_failures(const char *address)
* ".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 *address, uint32_t val,
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. */