diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-11-07 09:43:12 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-11-07 11:01:21 -0500 |
commit | 864c42f4d66641028005f8d11868368260a37b84 (patch) | |
tree | 1ff52e391cd2d7d4ae149b307396046d277cc278 /src/or/directory.c | |
parent | 667ba776b1d91c8d1229319be88191008975d6eb (diff) | |
download | tor-864c42f4d66641028005f8d11868368260a37b84.tar.gz tor-864c42f4d66641028005f8d11868368260a37b84.zip |
Count HTTP 503 as a download failure.
Because as Teor puts it: "[Resetting on 503] is exactly what we
don't want when relays are busy - imagine clients doing an automatic
reset every time they DoS a relay..."
Fixes bug 20593.
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 02f14387ad..d1333a8666 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -3933,15 +3933,16 @@ time_t download_status_increment_failure(download_status_t *dls, int status_code, const char *item, int server, time_t now) { + (void) status_code; // XXXX no longer used. + (void) server; // XXXX no longer used. int increment = -1; int min_delay = 0, max_delay = INT_MAX; tor_assert(dls); - /* only count the failure if it's permanent, or we're a server */ - if (status_code != 503 || server) { - if (dls->n_download_failures < IMPOSSIBLE_TO_DOWNLOAD-1) - ++dls->n_download_failures; + /* count the failure */ + if (dls->n_download_failures < IMPOSSIBLE_TO_DOWNLOAD-1) { + ++dls->n_download_failures; } if (dls->increment_on == DL_SCHED_INCREMENT_FAILURE) { |