From fe309e7ad633bee36e175e600f0b9a0ac18cf981 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 28 Sep 2010 13:29:31 -0400 Subject: Implement a basic node and nodelist type The node_t type is meant to serve two key functions: 1) Abstracting difference between routerinfo_t and microdesc_t so that clients can use microdesc_t instead of routerinfo_t. 2) Being a central place to hold mutable state about nodes formerly held in routerstatus_t and routerinfo_t. This patch implements a nodelist type that holds a node for every router that we would consider using. --- src/or/main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/or/main.c') diff --git a/src/or/main.c b/src/or/main.c index ddd5da364..072fd93a0 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -33,6 +33,7 @@ #include "main.h" #include "microdesc.h" #include "networkstatus.h" +#include "nodelist.h" #include "ntmain.h" #include "onion.h" #include "policies.h" @@ -1039,6 +1040,15 @@ run_scheduled_events(time_t now) */ consider_hibernation(now); + /* XXXX NM REMOVE THIS. XXXX NM XXXX NM XXXX NM*/ + { + static time_t nl_check_time = 0; + if (nl_check_time <= now) { + nodelist_assert_ok(); + nl_check_time = now + 30; + } + } + /* 0b. If we've deferred a signewnym, make sure it gets handled * eventually. */ if (signewnym_is_pending && @@ -2205,6 +2215,7 @@ tor_free_all(int postfork) connection_free_all(); buf_shrink_freelists(1); memarea_clear_freelist(); + nodelist_free_all(); microdesc_free_all(); if (!postfork) { config_free_all(); -- cgit v1.2.3