mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Special-case for retrieving own networkstatus by fingerprint: regenerate if dirty!
svn:r4943
This commit is contained in:
parent
465aec04c1
commit
6c4d43c724
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user