diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-02-23 12:32:15 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-02-23 12:32:15 -0500 |
commit | 22ec4d5426eecf1a8021d9b6b95f9a1518e96110 (patch) | |
tree | 0ac399a5a1cc4cbb307abe3dd9a8d790269376fa /src/or/networkstatus.c | |
parent | 92651641807c861c8f66ec3f117fbf3121450ad3 (diff) | |
download | tor-22ec4d5426eecf1a8021d9b6b95f9a1518e96110.tar.gz tor-22ec4d5426eecf1a8021d9b6b95f9a1518e96110.zip |
Fix infinite recursion when connect() fails in microdesc consensus fetch
The underlying fix is to stop indicating requests "ns" consensuses by
putting NULL in their requested_resource field: we already had a
specialized meaning for requested_resource==NULL, which was (more or
less) "Treat a failure here as a network failure, since it's too early
to possibly be a resource or directory failure." Overloading the two
meant that very early microdesc consensus download failures would get
treated as ns consensus download failures, so the failure count there
would get incremented, but the microdesc download would get retried
immediately in an infinite loop.
Fix for bug2381. Diagnosed by mobmix.
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r-- | src/or/networkstatus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index cccb1c0b6e..6387126393 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -1217,7 +1217,7 @@ update_consensus_networkstatus_downloads(time_t now) if (! we_want_to_fetch_flavor(options, i)) continue; - resource = i==FLAV_NS ? NULL : networkstatus_get_flavor_name(i); + resource = networkstatus_get_flavor_name(i); if (!download_status_is_ready(&consensus_dl_status[i], now, CONSENSUS_NETWORKSTATUS_MAX_DL_TRIES)) |