summaryrefslogtreecommitdiff
path: root/src/or/networkstatus.c
diff options
context:
space:
mode:
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-05-04 16:47:28 +1000
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-05-11 13:30:30 -0400
commitcdb528d841e753b6cc0b8d8b2aeb6bed183a1a8d (patch)
treeafde71681ae55859d70a038ea02ea1c7c2bb29cc /src/or/networkstatus.c
parent730cfeb6bd3d8060e44026469ec6d75695c00179 (diff)
downloadtor-cdb528d841e753b6cc0b8d8b2aeb6bed183a1a8d.tar.gz
tor-cdb528d841e753b6cc0b8d8b2aeb6bed183a1a8d.zip
Fetch certificates from the same directory as previous certificates
Improves the fix to #18963.
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r--src/or/networkstatus.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index cca45539aa..a3d11f4421 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -1506,8 +1506,8 @@ networkstatus_set_current_consensus_from_ns(networkstatus_t *c,
* consensus, even if it comes from many days in the past.
*
* If source_dir is non-NULL, it's the identity digest for a directory that
- * we've just successfully retrieved a consensus from, so try it first to
- * fetch any missing certificates.
+ * we've just successfully retrieved a consensus or certificates from, so try
+ * it first to fetch any missing certificates.
*
* Return 0 on success, <0 on failure. On failure, caller should increment
* the failure count as appropriate.
@@ -1802,9 +1802,14 @@ networkstatus_set_current_consensus(const char *consensus,
}
/** Called when we have gotten more certificates: see whether we can
- * now verify a pending consensus. */
+ * now verify a pending consensus.
+ *
+ * If source_dir is non-NULL, it's the identity digest for a directory that
+ * we've just successfully retrieved certificates from, so try it first to
+ * fetch any missing certificates.
+ */
void
-networkstatus_note_certs_arrived(void)
+networkstatus_note_certs_arrived(const char *source_dir)
{
int i;
for (i=0; i<N_CONSENSUS_FLAVORS; ++i) {
@@ -1817,7 +1822,7 @@ networkstatus_note_certs_arrived(void)
waiting_body,
networkstatus_get_flavor_name(i),
NSSET_WAS_WAITING_FOR_CERTS,
- NULL)) {
+ source_dir)) {
tor_free(waiting_body);
}
}