From eb3f24f027e9d160c5b5658e7d7f86a2acda880f Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sat, 8 Sep 2007 19:08:39 +0000 Subject: r14358@Kushana: nickm | 2007-09-08 13:45:16 -0400 Implement certificate fetch functions. svn:r11405 --- src/or/directory.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/or/directory.c') 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*/; -- cgit v1.2.3