aboutsummaryrefslogtreecommitdiff
path: root/src/or/nodelist.c
diff options
context:
space:
mode:
authorYawning Angel <yawning@schwanenlied.me>2015-02-18 13:58:13 +0000
committerYawning Angel <yawning@schwanenlied.me>2015-02-18 13:58:13 +0000
commit8571e86d27577e348bdb6398eda6190c2c63c0ed (patch)
tree6e235ac49f7080b488c12b9d01989a116393c404 /src/or/nodelist.c
parent6fdb179d84659fb14bacebf08c386cf21ec1b9d4 (diff)
downloadtor-8571e86d27577e348bdb6398eda6190c2c63c0ed.tar.gz
tor-8571e86d27577e348bdb6398eda6190c2c63c0ed.zip
Fix bootstrap directory information logging.
`dir_info_status` is used from main.c:directory_info_has_arrived() to provide useful (INFO/NOTICE) level logging to users, and should always be updated regardless of the rate limiting.
Diffstat (limited to 'src/or/nodelist.c')
-rw-r--r--src/or/nodelist.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index e9335063f1..ab05bce420 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -1685,12 +1685,14 @@ update_router_have_minimum_dir_info(void)
static ratelim_t last_warned =
RATELIM_INIT(NOTICE_DIR_INFO_STATUS_INTERVAL);
char *suppression_msg = NULL;
+
+ tor_snprintf(dir_info_status, sizeof(dir_info_status),
+ "We need more %sdescriptors: we have %d/%d, and "
+ "can only build %d%% of likely paths. (We have %s.)",
+ using_md?"micro":"", num_present, num_usable,
+ (int)(paths*100), status);
+
if ((suppression_msg = rate_limit_log(&last_warned, time(NULL)))) {
- tor_snprintf(dir_info_status, sizeof(dir_info_status),
- "We need more %sdescriptors: we have %d/%d, and "
- "can only build %d%% of likely paths. (We have %s.)",
- using_md?"micro":"", num_present, num_usable,
- (int)(paths*100), status);
if (!should_delay_dir_fetches(options, NULL) &&
!directory_too_idle_to_fetch_descriptors(options, now)) {
log_warn(LD_NET, "%s%s", dir_info_status, suppression_msg);
@@ -1706,12 +1708,14 @@ update_router_have_minimum_dir_info(void)
static ratelim_t last_warned =
RATELIM_INIT(NOTICE_DIR_INFO_STATUS_INTERVAL);
char *suppression_msg = NULL;
+
+ tor_snprintf(dir_info_status, sizeof(dir_info_status),
+ "We have enough %sdescriptors: we have %d/%d, and "
+ "can build %d%% of likely paths. (We have %s.)",
+ using_md?"micro":"", num_present, num_usable,
+ (int)(paths*100), status);
+
if ((suppression_msg = rate_limit_log(&last_warned, time(NULL)))) {
- tor_snprintf(dir_info_status, sizeof(dir_info_status),
- "We have enough %sdescriptors: we have %d/%d, and "
- "can build %d%% of likely paths. (We have %s.)",
- using_md?"micro":"", num_present, num_usable,
- (int)(paths*100), status);
log_info(LD_NET, "%s%s", dir_info_status, suppression_msg);
tor_free(suppression_msg);
}