]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge remote-tracking branch 'origin/maint-0.2.5'
authorNick Mathewson <nickm@torproject.org>
Mon, 29 Sep 2014 17:02:50 +0000 (13:02 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 29 Sep 2014 17:02:50 +0000 (13:02 -0400)
1  2 
src/common/sandbox.c
src/common/sandbox.h

index c7e4dcdf559cf1003a3429a13d4c5089f553b992,dbbaa59d7ce08c6e0821321bc2154baca3a46d5c..36022c921c82cc6ab2ae91308bcff9e4270a8465
@@@ -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,
Simple merge