diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-10-05 01:27:08 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-10-05 01:27:08 +0000 |
commit | 1223310b693881bb688f783acce4d308bc06f176 (patch) | |
tree | 2e224d928f80e4a0f69ac953d67bac72a4c18efd | |
parent | a60890507021f0c3e1607c164d5c952a392d9060 (diff) | |
download | tor-1223310b693881bb688f783acce4d308bc06f176.tar.gz tor-1223310b693881bb688f783acce4d308bc06f176.zip |
Downgrade noisy log messages in preparation for an alpha release.
svn:r5188
-rw-r--r-- | src/or/directory.c | 12 | ||||
-rw-r--r-- | src/or/routerlist.c | 45 |
2 files changed, 31 insertions, 26 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 29e3871b3e..86e850c1a8 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -993,8 +993,11 @@ connection_dir_client_reached_eof(connection_t *conn) n_asked_for = smartlist_len(which); } if (status_code != 200) { - /* 404 means that it didn't have them; no big deal. */ - log_fn(status_code == 404 ? LOG_INFO : LOG_WARN, + int no_warn = status_code == 404 || + (status_code == 400 && !strcmp(reason, "Servers unavailable.")); + /* 404 means that it didn't have them; no big deal. + * Older (pre-0.1.1.8) servers said 400 Servers unavailable instead. */ + log_fn(no_warn ? LOG_INFO : LOG_WARN, "Received http status code %d (\"%s\") from server '%s:%d' while fetching \"/tor/server/%s\". I'll try again soon.", status_code, reason, conn->address, conn->port, conn->requested_resource); @@ -1020,8 +1023,9 @@ connection_dir_client_reached_eof(connection_t *conn) directory_info_has_arrived(time(NULL), 0); } if (which) { /* mark remaining ones as failed */ - log_fn(LOG_NOTICE, "Received %d/%d routers.", - n_asked_for-smartlist_len(which), n_asked_for); + log_fn(LOG_INFO, "Received %d/%d routers requested from %s:%d", + n_asked_for-smartlist_len(which), n_asked_for, + conn->address, (int)conn->port); if (smartlist_len(which)) { dir_routerdesc_download_failed(which); } diff --git a/src/or/routerlist.c b/src/or/routerlist.c index fef8427acf..c41a1de9f3 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -1257,7 +1257,7 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg, log_fn(LOG_DEBUG, "Skipping unverified entry for verified router '%s'", router->nickname); routerinfo_free(router); - *msg = "Already have verified router with same nickname and different key."; + *msg = "Already have named router with same nickname and different key."; return -2; } } @@ -1313,6 +1313,7 @@ router_load_single_router(const char *s, const char **msg) { routerinfo_t *ri; tor_assert(msg); + smartlist_t *lst; *msg = NULL; if (!(ri = router_parse_entry_from_string(s, NULL))) { @@ -1326,22 +1327,23 @@ router_load_single_router(const char *s, const char **msg) routerinfo_free(ri); return 0; } - /* XXXX011 update router status from networkstatus!! */ + + lst = smartlist_create(); + smartlist_add(lst, ri); + routers_update_status_from_networkstatus(lst, 0); if (router_add_to_routerlist(ri, msg, 0)<0) { log_fn(LOG_WARN, "Couldn't add router to list: %s Dropping.", *msg?*msg:"(No message)."); /* we've already assigned to *msg now, and ri is already freed */ + smartlist_free(lst); return 0; } else { - smartlist_t *changed = smartlist_create(); - smartlist_add(changed, ri); - control_event_descriptors_changed(changed); - smartlist_free(changed); + control_event_descriptors_changed(lst); + smartlist_free(lst); + log_fn(LOG_DEBUG, "Added router to list"); + return 1; } - - log_fn(LOG_DEBUG, "Added router to list"); - return 1; } /** Given a string <b>s</b> containing some routerdescs, parse it and put the @@ -1513,8 +1515,9 @@ router_set_networkstatus(const char *s, time_t arrived_at, ns->networkstatus_digest, DIGEST_LEN)) { /* Same one we had before. */ networkstatus_free(ns); - log_fn(LOG_NOTICE, - "Dropping network-status from %s (published %s); already have it.", + log_fn(LOG_INFO, + "Not replacing network-status from %s (published %s); " + "we already have it.", trusted_dir->description, published); if (old_ns->received_on < arrived_at) { if (source != NS_FROM_CACHE) { @@ -1529,8 +1532,8 @@ router_set_networkstatus(const char *s, time_t arrived_at, } else if (old_ns->published_on >= ns->published_on) { char old_published[ISO_TIME_LEN+1]; format_iso_time(old_published, old_ns->published_on); - log_fn(LOG_NOTICE, - "Dropping network-status from %s (published %s);" + log_fn(LOG_INFO, + "Not replacing network-status from %s (published %s);" " we have a newer one (published %s) for this authority.", trusted_dir->description, published, old_published); @@ -1548,8 +1551,7 @@ router_set_networkstatus(const char *s, time_t arrived_at, if (!found) smartlist_add(networkstatus_list, ns); - /*XXXX011 downgrade to INFO NM */ - log_fn(LOG_NOTICE, "Setting networkstatus %s %s (published %s)", + log_fn(LOG_INFO, "Setting networkstatus %s %s (published %s)", source == NS_FROM_CACHE?"cached from": (source==NS_FROM_DIR?"downloaded from":"generated for"), trusted_dir->description, published); @@ -1750,15 +1752,14 @@ update_networkstatus_client_downloads(time_t now) needed = n_running_dirservers; if (needed) - /* XXXX011 Downgrade to info NM */ - log_fn(LOG_NOTICE, "For %d/%d running directory servers, we have %d live" + log_fn(LOG_INFO, "For %d/%d running directory servers, we have %d live" " network-status documents. Downloading %d.", n_running_dirservers, n_dirservers, n_live, needed); /* Also, download at least 1 every NETWORKSTATUS_CLIENT_DL_INTERVAL. */ if (n_running_dirservers && most_recent_received < now-NETWORKSTATUS_CLIENT_DL_INTERVAL && needed < 1) { - log_fn(LOG_NOTICE, "Our most recent network-status document (from %s) " + log_fn(LOG_INFO, "Our most recent network-status document (from %s) " "is %d seconds old; downloading another.", most_recent?most_recent->description:"nobody", (int)(now-most_recent_received)); @@ -2198,7 +2199,7 @@ networkstatus_list_update_recent(time_t now) ns->published_on + DEFAULT_RUNNING_INTERVAL > now) { if (!ns->is_recent) { format_iso_time(published, ns->published_on); - log_fn(LOG_NOTICE, + log_fn(LOG_INFO, "Networkstatus from %s (published %s) is now \"recent\"", src, published); changed = 1; @@ -2208,7 +2209,7 @@ networkstatus_list_update_recent(time_t now) } else { if (ns->is_recent) { format_iso_time(published, ns->published_on); - log_fn(LOG_NOTICE, + log_fn(LOG_INFO, "Networkstatus from %s (published %s) is no longer \"recent\"", src, published); changed = 1; @@ -2258,7 +2259,7 @@ routerstatus_list_update_from_networkstatus(time_t now) return; } - log_fn(LOG_NOTICE, "rebuilding router status list."); + log_fn(LOG_INFO, "Rebuilding router status list."); index = tor_malloc(sizeof(int)*n_statuses); size = tor_malloc(sizeof(int)*n_statuses); @@ -2647,7 +2648,7 @@ update_router_descriptor_downloads(time_t now) if (n_per_request < MIN_DL_PER_REQUEST) n_per_request = MIN_DL_PER_REQUEST; } - log_fn(LOG_NOTICE, "Launching %d request%s for %d router%s, %d at a time", + log_fn(LOG_INFO, "Launching %d request%s for %d router%s, %d at a time", (n_downloadable+n_per_request-1)/n_per_request, n_downloadable>n_per_request?"s":"", n_downloadable, n_downloadable>1?"s":"", n_per_request); |