diff options
author | Guinness <guinness@crans.org> | 2020-10-17 12:12:05 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-10-20 08:57:42 -0400 |
commit | 5248d08edeba7a952a788292db54638c1569ee1e (patch) | |
tree | 56915c7db056dd912d3ce71f712ae63727fd0546 /src/feature/dirclient | |
parent | bb249a221f35fe3cef53df4c36c84c2d5e63b66d (diff) | |
download | tor-5248d08edeba7a952a788292db54638c1569ee1e.tar.gz tor-5248d08edeba7a952a788292db54638c1569ee1e.zip |
Consider 301 as an error like 404
Tor does not follow redirects when bootstraping so we encountered an
error.
Fixes #40053
Diffstat (limited to 'src/feature/dirclient')
-rw-r--r-- | src/feature/dirclient/dirclient.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/feature/dirclient/dirclient.c b/src/feature/dirclient/dirclient.c index f088ef8283..22e6837edf 100644 --- a/src/feature/dirclient/dirclient.c +++ b/src/feature/dirclient/dirclient.c @@ -2505,9 +2505,12 @@ handle_response_fetch_desc(dir_connection_t *conn, } if (status_code != 200) { int dir_okay = status_code == 404 || - (status_code == 400 && !strcmp(reason, "Servers unavailable.")); + (status_code == 400 && !strcmp(reason, "Servers unavailable.")) || + status_code == 301; /* 404 means that it didn't have them; no big deal. - * Older (pre-0.1.1.8) servers said 400 Servers unavailable instead. */ + * Older (pre-0.1.1.8) servers said 400 Servers unavailable instead. + * 301 is considered as an error since Tor does not follow redirects, + * which means we failed to reach the server we wanted. */ log_fn(dir_okay ? LOG_INFO : LOG_WARN, LD_DIR, "Received http status code %d (%s) from server %s " "while fetching \"/tor/server/%s\". I'll try again soon.", |