diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-10-13 16:04:25 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-10-13 16:04:25 -0400 |
commit | 8c837db38f5b2015dd579de8d8df580f51d133bc (patch) | |
tree | 8a67afb20b2b998fa20b11c522acf1cb3cd634c6 /src/or/microdesc.c | |
parent | cbda016bc5f588351900433835bca912efeb41c4 (diff) | |
parent | c9dece14ae7d9c14c17df6685f7504c23eb65899 (diff) | |
download | tor-8c837db38f5b2015dd579de8d8df580f51d133bc.tar.gz tor-8c837db38f5b2015dd579de8d8df580f51d133bc.zip |
Merge branch 'nodes'
Diffstat (limited to 'src/or/microdesc.c')
-rw-r--r-- | src/or/microdesc.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/or/microdesc.c b/src/or/microdesc.c index dae66ae339..e014cd0761 100644 --- a/src/or/microdesc.c +++ b/src/or/microdesc.c @@ -4,11 +4,13 @@ #include "or.h" #include "config.h" #include "directory.h" +#include "dirserv.h" #include "microdesc.h" -#include "routerparse.h" #include "networkstatus.h" +#include "nodelist.h" +#include "policies.h" #include "routerlist.h" -#include "dirserv.h" +#include "routerparse.h" /** A data structure to hold a bunch of cached microdescriptors. There are * two active files in the cache: a "cache file" that we mmap, and a "journal @@ -249,6 +251,12 @@ microdescs_add_list_to_cache(microdesc_cache_t *cache, microdesc_cache_rebuild(cache); } + { + networkstatus_t *ns = networkstatus_get_latest_consensus(); + if (ns && ns->flavor == FLAV_MICRODESC) + SMARTLIST_FOREACH(added, microdesc_t *, md, nodelist_add_microdesc(md)); + } + return added; } @@ -474,7 +482,7 @@ microdesc_free(microdesc_t *md) SMARTLIST_FOREACH(md->family, char *, cp, tor_free(cp)); smartlist_free(md->family); } - tor_free(md->exitsummary); + short_policy_free(md->exit_policy); tor_free(md); } @@ -612,3 +620,4 @@ update_microdescs_from_networkstatus(time_t now) md->last_listed = ns->valid_after; } SMARTLIST_FOREACH_END(rs); } + |