diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-09-08 19:08:39 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-09-08 19:08:39 +0000 |
commit | eb3f24f027e9d160c5b5658e7d7f86a2acda880f (patch) | |
tree | 83ff95e67c1b0527d23042129be58cdc0a9d064d /src/or/directory.c | |
parent | 1c8bd05c7086d9023faed011fa11737ced7fa4fb (diff) | |
download | tor-eb3f24f027e9d160c5b5658e7d7f86a2acda880f.tar tor-eb3f24f027e9d160c5b5658e7d7f86a2acda880f.tar.gz |
r14358@Kushana: nickm | 2007-09-08 13:45:16 -0400
Implement certificate fetch functions.
svn:r11405
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 1813721cb..b645a0855 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -1298,7 +1298,22 @@ connection_dir_client_reached_eof(dir_connection_t *conn) /*XXXX020*/; } if (conn->_base.purpose == DIR_PURPOSE_FETCH_CERTIFICATE) { - /*XXXX020*/; + log_info(LD_DIR,"Received aurhority certificatess (size %d) from server " + "'%s:%d'",(int) body_len, conn->_base.address, conn->_base.port); + if (status_code != 200) { + log_fn(status_code == 403 ? LOG_INFO : LOG_WARN, LD_DIR, + "Received http status code %d (%s) from server " + "'%s:%d' while fetching \"/tor/keys/%s\".", + status_code, escaped(reason), conn->_base.address, + conn->_base.port, conn->requested_resource); + tor_free(body); tor_free(headers); tor_free(reason); + return -1; + } + if (trusted_dirs_load_certs_from_string(body, 0)<0) { + log_warn(LD_DIR, "Unable to parse fetched certificates"); + } else { + log_info(LD_DIR, "Successfully loaded certificates from fetch."); + } } if (conn->_base.purpose == DIR_PURPOSE_FETCH_STATUS_VOTE) { /*XXXX020*/; |