diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-03-09 15:53:37 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-03-09 15:53:37 +0000 |
commit | d40cbda2cd9e8f41e827d01f99450c760f339dbf (patch) | |
tree | 1c25213b3f85c50d87b73481456530dafe7255ed /src/or/policies.c | |
parent | 2f69c679573f6d5e5d3efbc0333255b5744b1776 (diff) | |
download | tor-d40cbda2cd9e8f41e827d01f99450c760f339dbf.tar.gz tor-d40cbda2cd9e8f41e827d01f99450c760f339dbf.zip |
Log cached-at-exit exit policies to try to fix bug 672.tor-0.2.1.13-alpha
svn:r18827
Diffstat (limited to 'src/or/policies.c')
-rw-r--r-- | src/or/policies.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/or/policies.c b/src/or/policies.c index 8ef8cdb690..a2ab13a90a 100644 --- a/src/or/policies.c +++ b/src/or/policies.c @@ -1316,8 +1316,23 @@ policies_free_all(void) addr_policy_list_free(authdir_badexit_policy); authdir_badexit_policy = NULL; - if (!HT_EMPTY(&policy_root)) - log_warn(LD_MM, "Still had some address policies cached at shutdown."); + if (!HT_EMPTY(&policy_root)) { + policy_map_ent_t **ent; + int n = 0; + char buf[POLICY_BUF_LEN]; + + log_warn(LD_MM, "Still had %d address policies cached at shutdown.", + (int)HT_SIZE(&policy_root)); + + /* Note the first 10 cached policies to try to figure out where they + * might be coming from. */ + HT_FOREACH(ent, policy_map, &policy_root) { + if (++n > 10) + break; + if (policy_write_item(buf, sizeof(buf), (*ent)->policy, 0) >= 0) + log_warn(LD_MM," %d [%d]: %s", n, (*ent)->policy->refcnt, buf); + } + } HT_CLEAR(policy_map, &policy_root); } |