mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 06:48:05 +01:00
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.
This commit is contained in:
parent
667ba776b1
commit
864c42f4d6
2 changed files with 11 additions and 4 deletions
6
changes/bug20593
Normal file
6
changes/bug20593
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
o Minor bugfixes (client directory scheduling):
|
||||||
|
- Treat "relay too busy to answer request" as a failed request and a
|
||||||
|
reason to back off on our retry frequency. This is safe now that
|
||||||
|
exponential backups retry indefinitely, and avoids a bug where we would
|
||||||
|
reset our download schedule erroneously.
|
||||||
|
Fixes bug 20593; bugfix on 0.2.9.1-alpha.
|
|
@ -3933,14 +3933,15 @@ time_t
|
||||||
download_status_increment_failure(download_status_t *dls, int status_code,
|
download_status_increment_failure(download_status_t *dls, int status_code,
|
||||||
const char *item, int server, time_t now)
|
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 increment = -1;
|
||||||
int min_delay = 0, max_delay = INT_MAX;
|
int min_delay = 0, max_delay = INT_MAX;
|
||||||
|
|
||||||
tor_assert(dls);
|
tor_assert(dls);
|
||||||
|
|
||||||
/* only count the failure if it's permanent, or we're a server */
|
/* count the failure */
|
||||||
if (status_code != 503 || server) {
|
if (dls->n_download_failures < IMPOSSIBLE_TO_DOWNLOAD-1) {
|
||||||
if (dls->n_download_failures < IMPOSSIBLE_TO_DOWNLOAD-1)
|
|
||||||
++dls->n_download_failures;
|
++dls->n_download_failures;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue