diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2015-10-18 18:04:48 +0300 |
---|---|---|
committer | rl1987 <rl1987@sdf.lonestar.org> | 2015-10-24 14:30:52 +0300 |
commit | cc1bed9974f90e7021468f9f85b0a66b21ee9151 (patch) | |
tree | 3c0c54d525d213a511f3b3b7dc63aeeccf54a83c /src/or | |
parent | bb8ec2e1c61e7083cda37845ad40bc0997a16901 (diff) | |
download | tor-cc1bed9974f90e7021468f9f85b0a66b21ee9151.tar.gz tor-cc1bed9974f90e7021468f9f85b0a66b21ee9151.zip |
Add a fifth unit test.
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/dns.c | 13 | ||||
-rw-r--r-- | src/or/dns.h | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/or/dns.c b/src/or/dns.c index d71246d61e..234dfbe687 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -2118,5 +2118,18 @@ assert_cache_ok_(void) } }); } + #endif +cached_resolve_t +*dns_get_cache_entry(cached_resolve_t *query) +{ + return HT_FIND(cache_map, &cache_root, query); +} + +void +dns_insert_cache_entry(cached_resolve_t *new_entry) +{ + HT_INSERT(cache_map, &cache_root, new_entry); +} + diff --git a/src/or/dns.h b/src/or/dns.h index 6af7796dbb..163d61b881 100644 --- a/src/or/dns.h +++ b/src/or/dns.h @@ -42,6 +42,10 @@ uint8_t answer_type,const cached_resolve_t *resolved)); MOCK_DECL(STATIC void,send_resolved_hostname_cell,(edge_connection_t *conn, const char *hostname)); + +cached_resolve_t *dns_get_cache_entry(cached_resolve_t *query); +void dns_insert_cache_entry(cached_resolve_t *new_entry); + #endif #endif |