summaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2016-02-22 03:02:01 -0500
committerRoger Dingledine <arma@torproject.org>2016-02-22 03:02:01 -0500
commite3eaee1d2cbd0bc03a40e374376ca72195a9d64d (patch)
tree1951d5400a2c39b10a975e16a48ee6005237f853 /src/or/directory.c
parent56c5e282a733912776f6dacbe4f5df66b4fb9606 (diff)
downloadtor-e3eaee1d2cbd0bc03a40e374376ca72195a9d64d.tar.gz
tor-e3eaee1d2cbd0bc03a40e374376ca72195a9d64d.zip
avoid redundant bootstrap events if the number of descs we just fetched is 0
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 7c3bfe5529..964b159512 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -1764,7 +1764,7 @@ load_downloaded_routers(const char *body, smartlist_t *which,
added = router_load_routers_from_string(body, NULL, SAVED_NOWHERE, which,
descriptor_digests, buf);
- if (general)
+ if (added && general)
control_event_bootstrap(BOOTSTRAP_STATUS_LOADING_DESCRIPTORS,
count_loading_descriptors_progress());
return added;
@@ -2166,10 +2166,11 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
/* Mark remaining ones as failed. */
dir_microdesc_download_failed(which, status_code);
}
- control_event_bootstrap(BOOTSTRAP_STATUS_LOADING_DESCRIPTORS,
- count_loading_descriptors_progress());
- if (mds && smartlist_len(mds))
+ if (mds && smartlist_len(mds)) {
+ control_event_bootstrap(BOOTSTRAP_STATUS_LOADING_DESCRIPTORS,
+ count_loading_descriptors_progress());
directory_info_has_arrived(now, 0, 1);
+ }
SMARTLIST_FOREACH(which, char *, cp, tor_free(cp));
smartlist_free(which);
smartlist_free(mds);