diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-02-18 12:08:29 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-02-18 12:08:29 -0500 |
commit | 1f06f494c8ce45946e565237a8a52785a8ece447 (patch) | |
tree | b069175937c642fed7f300e157bdcc8446469ea5 /src/core/or/connection_edge.h | |
parent | dcbc45e6b2f80e8bd3664972d6317331d6b3bc85 (diff) | |
download | tor-1f06f494c8ce45946e565237a8a52785a8ece447.tar.gz tor-1f06f494c8ce45946e565237a8a52785a8ece447.zip |
Move DNS TTL manipulation code to src/core/or
This removes a dependency from the client code on feature/relay.
Diffstat (limited to 'src/core/or/connection_edge.h')
-rw-r--r-- | src/core/or/connection_edge.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/or/connection_edge.h b/src/core/or/connection_edge.h index 11cb252935..8c06af5664 100644 --- a/src/core/or/connection_edge.h +++ b/src/core/or/connection_edge.h @@ -182,6 +182,21 @@ void connection_ap_warn_and_unmark_if_pending_circ( entry_connection_t *entry_conn, const char *where); +/** Lowest value for DNS ttl that a server should give or a client should + * believe. */ +#define MIN_DNS_TTL (5*60) +/** Highest value for DNS ttl that a server should give or a client should + * believe. */ +#define MAX_DNS_TTL (60*60) +/** How long do we keep DNS cache entries before purging them (regardless of + * their TTL)? */ +#define MAX_DNS_ENTRY_AGE (3*60*60) +/** How long do we cache/tell clients to cache DNS records when no TTL is + * known? */ +#define DEFAULT_DNS_TTL (30*60) + +uint32_t clip_dns_ttl(uint32_t ttl); + int connection_half_edge_is_valid_data(const smartlist_t *half_conns, streamid_t stream_id); int connection_half_edge_is_valid_sendme(const smartlist_t *half_conns, |