diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-07-27 23:18:58 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-07-27 23:18:58 +0000 |
commit | 43f64d09ead908957d9a12b181443e67d388774e (patch) | |
tree | 64da537066d1494d1942d1f7b8cb0a0897bf72d7 /src/or/dirserv.c | |
parent | f6229d6432ba2d15b5f018df8acb2b3e31379df0 (diff) | |
download | tor-43f64d09ead908957d9a12b181443e67d388774e.tar tor-43f64d09ead908957d9a12b181443e67d388774e.tar.gz |
r13951@catbus: nickm | 2007-07-27 18:39:28 -0400
Make it so we can actually compile with FULL_V1_DIRECTORIES disabled.
svn:r10952
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index b0716d46f..e371ff7cb 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -32,6 +32,13 @@ static int the_directory_is_dirty = 1; static int runningrouters_is_dirty = 1; static int the_v2_networkstatus_is_dirty = 1; +/** Most recently generated encoded signed v1 directory. (v1 auth dirservers + * only.) */ +static cached_dir_t *the_directory = NULL; + +/** For authoritative directories: the current (v1) network status. */ +static cached_dir_t the_runningrouters = { NULL, NULL, 0, 0, 0, -1 }; + static void directory_remove_invalid(void); static cached_dir_t *dirserv_regenerate_directory(void); static char *format_versions_list(config_line_t *ln); @@ -962,8 +969,12 @@ dirserv_dump_directory_to_string(char **dir_out, char *buf = NULL; size_t buf_len; size_t identity_pkey_len; - routerlist_t *rl = router_get_routerlist(); time_t now = time(NULL); +#ifdef FULL_V1_DIRECTORIES + routerlist_t *rl = router_get_routerlist(); +#else + (void)complete; +#endif tor_assert(dir_out); *dir_out = NULL; @@ -1059,10 +1070,6 @@ dirserv_dump_directory_to_string(char **dir_out, return -1; } -/** Most recently generated encoded signed v1 directory. (v1 auth dirservers - * only.) */ -static cached_dir_t *the_directory = NULL; - /* Used only by non-v1-auth dirservers: The v1 directory and * runningrouters we'll serve when requested. */ static cached_dir_t *cached_directory = NULL; @@ -1365,9 +1372,6 @@ dirserv_regenerate_directory(void) return the_directory; } -/** For authoritative directories: the current (v1) network status. */ -static cached_dir_t the_runningrouters = { NULL, NULL, 0, 0, 0, -1 }; - /** Only called by v1 auth dirservers. * Replace the current running-routers list with a newly generated one. */ static cached_dir_t * @@ -1381,7 +1385,9 @@ generate_runningrouters(void) crypto_pk_env_t *private_key = get_identity_key(); char *identity_pkey; /* Identity key, DER64-encoded. */ size_t identity_pkey_len; +#ifdef FULL_V1_DIRECTORIES routerlist_t *rl = router_get_routerlist(); +#endif #ifdef FULL_V1_DIRECTORIES if (list_server_status(rl->routers, &router_status, 0)) { |