mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 13:13:44 +01:00
tell the user if we're delaying his newnym request. also, pick
a different set of fenceposts. svn:r9647
This commit is contained in:
parent
bf1b4df2b6
commit
d6c21ab8a7
@ -352,8 +352,8 @@ connection_dir_download_routerdesc_failed(dir_connection_t *conn)
|
||||
/* No need to increment the failure count for routerdescs, since
|
||||
* it's not their fault. */
|
||||
|
||||
/* There's no relaunch descriptor downloads here: we already do it every 10
|
||||
* seconds (DESCRIPTOR_RETRY_INTERVAL) in main.c */
|
||||
/* No need to relaunch descriptor downloads here: we already do it
|
||||
* every 10 seconds (DESCRIPTOR_RETRY_INTERVAL) in main.c. */
|
||||
|
||||
(void) conn;
|
||||
}
|
||||
@ -2057,8 +2057,8 @@ dir_routerdesc_download_failed(smartlist_t *failed, int status_code)
|
||||
cp, (int)rs->n_download_failures);
|
||||
});
|
||||
|
||||
/* There's no relaunch descriptor downloads here: we already do it every 10
|
||||
* seconds (DESCRIPTOR_RETRY_INTERVAL) in main.c */
|
||||
/* No need to relaunch descriptor downloads here: we already do it
|
||||
* every 10 seconds (DESCRIPTOR_RETRY_INTERVAL) in main.c. */
|
||||
}
|
||||
|
||||
/** Given a directory <b>resource</b> request, containing zero
|
||||
|
@ -756,7 +756,8 @@ run_scheduled_events(time_t now)
|
||||
/* 0b. If we've deferred a signewnym, make sure it gets handled
|
||||
* eventually */
|
||||
if (signewnym_is_pending &&
|
||||
time_of_last_signewnym + MAX_SIGNEWNYM_RATE < now) {
|
||||
time_of_last_signewnym + MAX_SIGNEWNYM_RATE <= now) {
|
||||
log(LOG_INFO, LD_CONTROL, "Honoring delayed NEWNYM request");
|
||||
circuit_expire_all_dirty_circs();
|
||||
addressmap_clear_transient();
|
||||
time_of_last_signewnym = now;
|
||||
@ -1389,9 +1390,15 @@ signal_callback(int fd, short events, void *arg)
|
||||
#endif
|
||||
case SIGNEWNYM: {
|
||||
time_t now = time(NULL);
|
||||
if (time_of_last_signewnym + MAX_SIGNEWNYM_RATE >= now) {
|
||||
if (time_of_last_signewnym + MAX_SIGNEWNYM_RATE > now) {
|
||||
signewnym_is_pending = 1;
|
||||
log(LOG_NOTICE, LD_CONTROL,
|
||||
"Rate limiting NEWNYM request: delaying by %d second(s)",
|
||||
(int)(MAX_SIGNEWNYM_RATE+time_of_last_signewnym-now));
|
||||
} else {
|
||||
/* XXX refactor someday: these two calls are in
|
||||
* run_scheduled_events() above too, and they should be in just
|
||||
* one place. */
|
||||
circuit_expire_all_dirty_circs();
|
||||
addressmap_clear_transient();
|
||||
time_of_last_signewnym = now;
|
||||
|
@ -1911,7 +1911,7 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
|
||||
|
||||
if (!signed_desc_digest_is_recognized(&router->cache_info)) {
|
||||
/* We asked for it, so some networkstatus must have listed it when we
|
||||
* did. save it in case we're a cache and somebody else asks for it. */
|
||||
* did. Save it if we're a cache in case somebody else asks for it. */
|
||||
log_info(LD_DIR,
|
||||
"Received a no-longer-recognized descriptor for router '%s'",
|
||||
router->nickname);
|
||||
|
Loading…
Reference in New Issue
Block a user