diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2009-10-27 14:14:52 +0100 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2009-10-27 14:19:32 +0100 |
commit | b0e8c33617edec7ec58ce36542cf7d8a4514d89e (patch) | |
tree | 81eecbed0c0a1184b7991e759c4b68d1dd8906fd /src/or/directory.c | |
parent | 70abd843fd006cd25dadd388e5f4ff753c3a4668 (diff) | |
download | tor-b0e8c33617edec7ec58ce36542cf7d8a4514d89e.tar.gz tor-b0e8c33617edec7ec58ce36542cf7d8a4514d89e.zip |
Make it more obvious for coverity that cid 404 is not dead code
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index e703bd438a..0a090e6f16 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -1463,21 +1463,22 @@ connection_dir_client_reached_eof(dir_connection_t *conn) } (void) skewed; /* skewed isn't used yet. */ - if (status_code == 503 && body_len < 16) { - routerstatus_t *rs; - trusted_dir_server_t *ds; - log_info(LD_DIR,"Received http status code %d (%s) from server " - "'%s:%d'. I'll try again soon.", - status_code, escaped(reason), conn->_base.address, - conn->_base.port); - if ((rs = router_get_consensus_status_by_id(conn->identity_digest))) - rs->last_dir_503_at = now; - if ((ds = router_get_trusteddirserver_by_digest(conn->identity_digest))) - ds->fake_status.last_dir_503_at = now; + if (status_code == 503) { + if (body_len < 16) { + routerstatus_t *rs; + trusted_dir_server_t *ds; + log_info(LD_DIR,"Received http status code %d (%s) from server " + "'%s:%d'. I'll try again soon.", + status_code, escaped(reason), conn->_base.address, + conn->_base.port); + if ((rs = router_get_consensus_status_by_id(conn->identity_digest))) + rs->last_dir_503_at = now; + if ((ds = router_get_trusteddirserver_by_digest(conn->identity_digest))) + ds->fake_status.last_dir_503_at = now; - tor_free(body); tor_free(headers); tor_free(reason); - return -1; - } else if (status_code == 503) { + tor_free(body); tor_free(headers); tor_free(reason); + return -1; + } /* XXXX022 Remove this once every server with bug 539 is obsolete. */ log_info(LD_DIR, "Server at '%s:%d' sent us a 503 response, but included " "a body anyway. We'll pretend it gave us a 200.", |