summaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-02-23 10:45:39 -0500
committerNick Mathewson <nickm@torproject.org>2016-02-23 10:45:39 -0500
commitd3af4f4e43267f79239d116fd2c35e0ca9632f8b (patch)
tree77a5447f50ea8ccdf520665f18ea8541e62023c0 /src/or/directory.c
parente88686cb2cbae39333982505f38f2d7568af4f32 (diff)
parente3eaee1d2cbd0bc03a40e374376ca72195a9d64d (diff)
downloadtor-d3af4f4e43267f79239d116fd2c35e0ca9632f8b.tar.gz
tor-d3af4f4e43267f79239d116fd2c35e0ca9632f8b.zip
Merge remote-tracking branch 'arma/bug16825'
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 109dbce7eb..627699118c 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;
@@ -1965,7 +1965,7 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
routers_update_all_from_networkstatus(now, 3);
update_microdescs_from_networkstatus(now);
update_microdesc_downloads(now);
- directory_info_has_arrived(now, 0);
+ directory_info_has_arrived(now, 0, 0);
log_info(LD_DIR, "Successfully loaded consensus.");
}
@@ -2001,7 +2001,7 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
* ones got flushed to disk so it's safe to call this on them */
connection_dir_download_cert_failed(conn, status_code);
} else {
- directory_info_has_arrived(now, 0);
+ directory_info_has_arrived(now, 0, 0);
log_info(LD_DIR, "Successfully loaded certificates from fetch.");
}
} else {
@@ -2115,7 +2115,7 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
if (load_downloaded_routers(body, which, descriptor_digests,
conn->router_purpose,
conn->base_.address))
- directory_info_has_arrived(now, 0);
+ directory_info_has_arrived(now, 0, 0);
}
}
if (which) { /* mark remaining ones as failed */
@@ -2166,8 +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)) {
+ 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);