Stop relays calling directory_fetches_from_authorities on dir downloads
commitc86013291bd26f3497e9efcf96125342d97cba33
authorteor <teor2345@gmail.com>
Mon, 11 Sep 2017 04:21:48 +0000 (11 14:21 +1000)
committerteor <teor2345@gmail.com>
Tue, 12 Sep 2017 23:46:17 +0000 (13 09:46 +1000)
treec393a54f232db03663caedd756be5436556da4c1
parent3138fe2e694a7036d28427ee3d76e639d15e4bc0
Stop relays calling directory_fetches_from_authorities on dir downloads

This change refactors find_dl_schedule() to only call dependent functions
as needed. In particular, directory_fetches_from_authorities() only needs
to be called on clients.

Stopping spurious directory_fetches_from_authorities() calls on every
download on public relays has the following impacts:
* fewer address resolution attempts, particularly those mentioned in 21789
* fewer descriptor rebuilds
* fewer log messages, particularly those limited in 20610

Fixes 23470 in 0.2.8.1-alpha.
The original bug was introduced in commit 35bbf2e as part of prop210.
changes/bug23470 [new file with mode: 0644]
src/or/directory.c