diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-03-17 14:15:12 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-03-27 14:23:19 -0400 |
commit | 0389d4aa561bec06ad2aab70ea5a989f1f2d02c6 (patch) | |
tree | a010468c5cb5f55cc6949634aa3356aad8097a68 /src/or/nodelist.c | |
parent | cbf9e742368158b927249913b395b3796d847a92 (diff) | |
download | tor-0389d4aa561bec06ad2aab70ea5a989f1f2d02c6.tar.gz tor-0389d4aa561bec06ad2aab70ea5a989f1f2d02c6.zip |
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.
Diffstat (limited to 'src/or/nodelist.c')
-rw-r--r-- | src/or/nodelist.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c index 178f084b69..d92ef17339 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 <b>md</b> 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 <b>node</b> */ static void node_free(node_t *node) |