From 0389d4aa561bec06ad2aab70ea5a989f1f2d02c6 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 17 Mar 2014 14:15:12 -0400 Subject: More logs to try to diagnose bug 7164 This time, check in microdesc_cache_clean() to see what could be going wrong with an attempt to clean a microdesc that's held by a node. --- src/or/nodelist.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/or/nodelist.c') diff --git a/src/or/nodelist.c b/src/or/nodelist.c index 178f084b6..d92ef1733 100644 --- a/src/or/nodelist.c +++ b/src/or/nodelist.c @@ -337,6 +337,25 @@ nodelist_drop_node(node_t *node, int remove_from_ht) node->nodelist_idx = -1; } +/** Return a newly allocated smartlist of the nodes that have md as + * their microdescriptor. */ +smartlist_t * +nodelist_find_nodes_with_microdesc(const microdesc_t *md) +{ + smartlist_t *result = smartlist_new(); + + if (the_nodelist == NULL) + return result; + + SMARTLIST_FOREACH_BEGIN(the_nodelist->nodes, node_t *, node) { + if (node->md == md) { + smartlist_add(result, node); + } + } SMARTLIST_FOREACH_END(node); + + return result; +} + /** Release storage held by node */ static void node_free(node_t *node) -- cgit v1.2.3