diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-12-12 02:10:19 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-12-12 02:10:19 -0500 |
commit | 9e6225ae1662e10f3e6c32af52736b60eb489b55 (patch) | |
tree | 58bd66dc3650837882fcea828c3c5817a15e449c /src/or | |
parent | 0c1b3070cfec670190636d74f97c2aaf0e521bdb (diff) | |
parent | f1b7295b27ba1f472304f2931bb23df6884b64e6 (diff) | |
download | tor-9e6225ae1662e10f3e6c32af52736b60eb489b55.tar tor-9e6225ae1662e10f3e6c32af52736b60eb489b55.tar.gz |
Merge commit 'sebastian/coverity'
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/config.c | 5 | ||||
-rw-r--r-- | src/or/directory.c | 29 |
2 files changed, 19 insertions, 15 deletions
diff --git a/src/or/config.c b/src/or/config.c index 416cbc130..deeda163b 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1575,7 +1575,10 @@ config_get_commandlines(int argc, char **argv, config_line_t **result) *new = tor_malloc_zero(sizeof(config_line_t)); s = argv[i]; - while (*s == '-') + /* Each keyword may be prefixed with one or two dashes. */ + if (*s == '-') + s++; + if (*s == '-') s++; (*new)->key = tor_strdup(expand_abbrev(&options_format, s, 1, 1)); diff --git a/src/or/directory.c b/src/or/directory.c index 427f5d8c0..45483cce2 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.", |