diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-10-20 09:03:26 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-10-20 09:03:26 -0400 |
commit | 579f200efc45e6c38e62e1104b3a869dc4beb3d8 (patch) | |
tree | 6185055edee91b5c3c8b2edf1f9351929fbae29c | |
parent | 19302a1dfd8da73ff86b0c36534221b71c501c32 (diff) | |
parent | 5248d08edeba7a952a788292db54638c1569ee1e (diff) | |
download | tor-579f200efc45e6c38e62e1104b3a869dc4beb3d8.tar.gz tor-579f200efc45e6c38e62e1104b3a869dc4beb3d8.zip |
Merge branch 'mr_175_squashed'
-rw-r--r-- | changes/ticket40053 | 5 | ||||
-rw-r--r-- | src/feature/dirclient/dirclient.c | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/changes/ticket40053 b/changes/ticket40053 new file mode 100644 index 0000000000..0226f3ceef --- /dev/null +++ b/changes/ticket40053 @@ -0,0 +1,5 @@ + o Minor features (logging): + - Consider 301 as an error like a 404 when processing the response to a + request for a group of server descriptors or an extrainfo documents. + Closes ticket 40053. + diff --git a/src/feature/dirclient/dirclient.c b/src/feature/dirclient/dirclient.c index b41ae107b3..74e68ac6be 100644 --- a/src/feature/dirclient/dirclient.c +++ b/src/feature/dirclient/dirclient.c @@ -2509,9 +2509,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.", |