diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-09-08 20:18:15 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-09-08 20:18:15 +0000 |
commit | 059148f5880de62e29ec63f5ca17cecc5767dfa1 (patch) | |
tree | 9964583eafd2d621646971ed2823491e0f2ee3a6 /src/or/directory.c | |
parent | 6c4d43c724ff44bc68e52a7bfcd5b79cbbec42d7 (diff) | |
download | tor-059148f5880de62e29ec63f5ca17cecc5767dfa1.tar.gz tor-059148f5880de62e29ec63f5ca17cecc5767dfa1.zip |
Only caches download network-status for now, and they use a different strategy. Add an element to connection_t to remember what we are downloading, and a function to recognize our own fingerprint.
svn:r4944
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index a91ab64b92..2b13cbae86 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -180,9 +180,6 @@ directory_get_from_dirserver(uint8_t purpose, const char *resource, char digest[DIGEST_LEN]; base16_decode(digest, DIGEST_LEN, resource+3, HEX_DIGEST_LEN); ds = router_get_trusteddirserver_by_digest(digest); - // XXXXX NM remove this. - log_fn(LOG_NOTICE, "Going straight to the authority for %s? %s",resource, - ds? "Ok.":"Oops. I can't."); } if (!ds && fetch_fresh_first) { /* only ask authdirservers, and don't ask myself */ @@ -403,6 +400,9 @@ directory_send_command(connection_t *conn, const char *platform, tor_assert(conn); tor_assert(conn->type == CONN_TYPE_DIR); + tor_free(conn->requested_resource); + conn->requested_resource = tor_strdup(resource); + /* come up with a string for which Host: we want */ if (conn->port == 80) { strlcpy(hoststring, conn->address, sizeof(hoststring)); @@ -453,7 +453,6 @@ directory_send_command(connection_t *conn, const char *platform, httpcommand = "GET";//XXXX len = strlen(resource)+32; url = tor_malloc(len); - log_fn(LOG_NOTICE, "Asking for %s", resource); tor_snprintf(url, len, "/tor/status/%s", resource); break; case DIR_PURPOSE_FETCH_SERVERDESC: @@ -889,7 +888,8 @@ connection_dir_client_reached_eof(connection_t *conn) if (conn->purpose == DIR_PURPOSE_FETCH_NETWORKSTATUS) { /* XXXX NM We *must* make certain we get the one(s) we asked for or we - * could be partitioned. */ + * could be partitioned. Also, never ask someone else for a status we + * generated! */ log_fn(LOG_INFO,"Received networkstatus objects (size %d) from server '%s:%d'",(int) body_len, conn->address, conn->port); if (status_code != 200) { log_fn(LOG_WARN,"Received http status code %d (\"%s\") from server '%s:%d'. Failing.", |