/* 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;
}
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
/* 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;
#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;
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);