summaryrefslogtreecommitdiff
path: root/src/or/directory.h
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2017-07-05 01:29:35 +1000
committerNick Mathewson <nickm@torproject.org>2017-07-07 13:18:04 -0400
commit344f5a71c5a2a697050c7e6545578c5a01eee0a5 (patch)
tree2fdc8e2256e8d65fc0bbd789abc0f6b610443028 /src/or/directory.h
parentf813b05202171a1b39d9428e68885b36fcceef11 (diff)
downloadtor-344f5a71c5a2a697050c7e6545578c5a01eee0a5.tar.gz
tor-344f5a71c5a2a697050c7e6545578c5a01eee0a5.zip
Use download_status_get_next_attempt_at() more often
This guards against future occurrences of 17750.
Diffstat (limited to 'src/or/directory.h')
-rw-r--r--src/or/directory.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/directory.h b/src/or/directory.h
index 8ff16b3535..c473d8e4ca 100644
--- a/src/or/directory.h
+++ b/src/or/directory.h
@@ -108,6 +108,8 @@ time_t download_status_increment_attempt(download_status_t *dls,
void download_status_reset(download_status_t *dls);
static int download_status_is_ready(download_status_t *dls, time_t now,
int max_failures);
+time_t download_status_get_next_attempt_at(const download_status_t *dls);
+
/** Return true iff, as of <b>now</b>, the resource tracked by <b>dls</b> is
* ready to get its download reattempted. */
static inline int
@@ -127,7 +129,7 @@ download_status_is_ready(download_status_t *dls, time_t now,
if (!under_failure_limit)
return 0;
}
- return dls->next_attempt_at <= now;
+ return download_status_get_next_attempt_at(dls) <= now;
}
static void download_status_mark_impossible(download_status_t *dl);
@@ -141,7 +143,6 @@ download_status_mark_impossible(download_status_t *dl)
int download_status_get_n_failures(const download_status_t *dls);
int download_status_get_n_attempts(const download_status_t *dls);
-time_t download_status_get_next_attempt_at(const download_status_t *dls);
/* Yes, these two functions are confusingly similar.
* Let's sort that out in #20077. */