mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-14 07:03:44 +01:00
when an OR starts up, it loads its directory from cache.
then it serves *that directory* to others who ask for a copy of the directory. it's better to serve no directory at all until you have a fresh copy. svn:r2418
This commit is contained in:
parent
6a7c44046e
commit
8b02610bd5
@ -794,11 +794,11 @@ int router_load_routerlist_from_string(const char *s, int trusted)
|
|||||||
* pkey; else check against the pkey of the signing directory server. */
|
* pkey; else check against the pkey of the signing directory server. */
|
||||||
int router_load_routerlist_from_directory(const char *s,
|
int router_load_routerlist_from_directory(const char *s,
|
||||||
crypto_pk_env_t *pkey,
|
crypto_pk_env_t *pkey,
|
||||||
int check_version)
|
int dir_is_recent)
|
||||||
{
|
{
|
||||||
routerlist_t *new_list = NULL;
|
routerlist_t *new_list = NULL;
|
||||||
if (router_parse_routerlist_from_directory(s, &new_list, pkey,
|
if (router_parse_routerlist_from_directory(s, &new_list, pkey,
|
||||||
check_version)) {
|
dir_is_recent)) {
|
||||||
log_fn(LOG_WARN, "Couldn't parse directory.");
|
log_fn(LOG_WARN, "Couldn't parse directory.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -823,6 +823,7 @@ int router_load_routerlist_from_directory(const char *s,
|
|||||||
dirserv_load_from_directory_string(s);
|
dirserv_load_from_directory_string(s);
|
||||||
} else {
|
} else {
|
||||||
/* Remember the directory. */
|
/* Remember the directory. */
|
||||||
|
if(dir_is_recent)
|
||||||
dirserv_set_cached_directory(s, routerlist->published_on);
|
dirserv_set_cached_directory(s, routerlist->published_on);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user