From: Nick Mathewson Date: Mon, 29 Sep 2014 17:02:50 +0000 (-0400) Subject: Merge remote-tracking branch 'origin/maint-0.2.5' X-Git-Tag: tor-0.2.6.1-alpha~62 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2e607ff51931b35ee531fa60b83487b3f4f944a7;p=thirdparty%2Ftor.git Merge remote-tracking branch 'origin/maint-0.2.5' --- 2e607ff51931b35ee531fa60b83487b3f4f944a7 diff --cc src/common/sandbox.c index c7e4dcdf55,dbbaa59d7c..36022c921c --- a/src/common/sandbox.c +++ b/src/common/sandbox.c @@@ -1292,11 -1380,23 +1292,23 @@@ static HT_HEAD(getaddrinfo_cache, cache HT_PROTOTYPE(getaddrinfo_cache, cached_getaddrinfo_item_t, node, cached_getaddrinfo_item_hash, cached_getaddrinfo_items_eq); -HT_GENERATE(getaddrinfo_cache, cached_getaddrinfo_item_t, node, - cached_getaddrinfo_item_hash, - cached_getaddrinfo_items_eq, - 0.6, tor_malloc_, tor_realloc_, tor_free_); +HT_GENERATE2(getaddrinfo_cache, cached_getaddrinfo_item_t, node, + cached_getaddrinfo_item_hash, + cached_getaddrinfo_items_eq, + 0.6, tor_reallocarray_, tor_free_) + /** If true, don't try to cache getaddrinfo results. */ + static int sandbox_getaddrinfo_cache_disabled = 0; + + /** Tell the sandbox layer not to try to cache getaddrinfo results. Used as in + * tor-resolve, when we have no intention of initializing crypto or of + * installing the sandbox.*/ + void + sandbox_disable_getaddrinfo_cache(void) + { + sandbox_getaddrinfo_cache_disabled = 1; + } + int sandbox_getaddrinfo(const char *name, const char *servname, const struct addrinfo *hints,