diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-09-08 19:29:21 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-09-08 19:29:21 +0000 |
commit | 6c4d43c724ff44bc68e52a7bfcd5b79cbbec42d7 (patch) | |
tree | a12e81947272632d01190a6b1e138b975cd2af71 /src/or/dirserv.c | |
parent | 465aec04c158ba8c9eb629b98e8b61d1b2cc8986 (diff) | |
download | tor-6c4d43c724ff44bc68e52a7bfcd5b79cbbec42d7.tar.gz tor-6c4d43c724ff44bc68e52a7bfcd5b79cbbec42d7.zip |
Special-case for retrieving own networkstatus by fingerprint: regenerate if dirty!
svn:r4943
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 3c4f03ddac..654cc19889 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -1183,13 +1183,19 @@ dirserv_get_networkstatus_v2(smartlist_t *result, smartlist_add(result, val); } } else if (!strcmpstart(key, "fp/")) { + char own_fp[HEX_DIGEST_LEN+1]; + crypto_pk_get_fingerprint(get_identity_key(), own_fp, 0); smartlist_t *hexdigests = smartlist_create(); smartlist_split_string(hexdigests, key+3, "+", 0, 0); SMARTLIST_FOREACH(hexdigests, char *, cp, { cached_dir_t *cached; tor_strupper(cp); - /* XXXX special-case own key? */ + if (!strcmp(cp, own_fp) && + get_options()->AuthoritativeDir && + the_v2_networkstatus_is_dirty && + the_v2_networkstatus_is_dirty + DIR_REGEN_SLACK_TIME < time(NULL)) + generate_v2_networkstatus(); cached = strmap_get(cached_v2_networkstatus, cp); if (cached) smartlist_add(result, cached); |