mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
avoid redundant bootstrap events if the number of descs we just fetched is 0
This commit is contained in:
parent
56c5e282a7
commit
e3eaee1d2c
@ -1764,7 +1764,7 @@ load_downloaded_routers(const char *body, smartlist_t *which,
|
|||||||
|
|
||||||
added = router_load_routers_from_string(body, NULL, SAVED_NOWHERE, which,
|
added = router_load_routers_from_string(body, NULL, SAVED_NOWHERE, which,
|
||||||
descriptor_digests, buf);
|
descriptor_digests, buf);
|
||||||
if (general)
|
if (added && general)
|
||||||
control_event_bootstrap(BOOTSTRAP_STATUS_LOADING_DESCRIPTORS,
|
control_event_bootstrap(BOOTSTRAP_STATUS_LOADING_DESCRIPTORS,
|
||||||
count_loading_descriptors_progress());
|
count_loading_descriptors_progress());
|
||||||
return added;
|
return added;
|
||||||
@ -2166,10 +2166,11 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
|
|||||||
/* Mark remaining ones as failed. */
|
/* Mark remaining ones as failed. */
|
||||||
dir_microdesc_download_failed(which, status_code);
|
dir_microdesc_download_failed(which, status_code);
|
||||||
}
|
}
|
||||||
|
if (mds && smartlist_len(mds)) {
|
||||||
control_event_bootstrap(BOOTSTRAP_STATUS_LOADING_DESCRIPTORS,
|
control_event_bootstrap(BOOTSTRAP_STATUS_LOADING_DESCRIPTORS,
|
||||||
count_loading_descriptors_progress());
|
count_loading_descriptors_progress());
|
||||||
if (mds && smartlist_len(mds))
|
|
||||||
directory_info_has_arrived(now, 0, 1);
|
directory_info_has_arrived(now, 0, 1);
|
||||||
|
}
|
||||||
SMARTLIST_FOREACH(which, char *, cp, tor_free(cp));
|
SMARTLIST_FOREACH(which, char *, cp, tor_free(cp));
|
||||||
smartlist_free(which);
|
smartlist_free(which);
|
||||||
smartlist_free(mds);
|
smartlist_free(mds);
|
||||||
|
Loading…
Reference in New Issue
Block a user