diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-09-28 13:29:31 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-10-01 18:14:26 -0400 |
commit | fe309e7ad633bee36e175e600f0b9a0ac18cf981 (patch) | |
tree | 5e4bc848a6c65ec4eb91f8994ab9980a5ec20fb0 /src/or/main.c | |
parent | 80b515b85fdfbcd645cb1920e398b3f2f6e85a31 (diff) | |
download | tor-fe309e7ad633bee36e175e600f0b9a0ac18cf981.tar tor-fe309e7ad633bee36e175e600f0b9a0ac18cf981.tar.gz |
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.
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 11 |
1 files changed, 11 insertions, 0 deletions
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(); |