12 #ifndef TOR_DLSTATUS_H
13 #define TOR_DLSTATUS_H
16 int status_code,
const char *item,
17 int server, time_t now);
19 const char *item, time_t now);
22 #define download_status_failed(dls, sc) \
23 download_status_increment_failure((dls), (sc), NULL, \
24 dir_server_mode(get_options()), \
35 #ifdef DLSTATUS_PRIVATE
52 #define DIR_DEFAULT_RANDOM_MULTIPLIER (3)
54 #define DIR_TEST_NET_RANDOM_MULTIPLIER (2)
STATIC void next_random_exponential_delay_range(int *low_bound_out, int *high_bound_out, int delay, int base_delay)
STATIC int download_status_schedule_get_delay(download_status_t *dls, int min_delay, time_t now)
STATIC int find_dl_min_delay(const download_status_t *dls, const or_options_t *options)
STATIC int next_random_exponential_delay(int delay, int base_delay)
int download_status_get_n_attempts(const download_status_t *dls)
int download_status_is_ready(download_status_t *dls, time_t now)
int download_status_get_n_failures(const download_status_t *dls)
time_t download_status_increment_attempt(download_status_t *dls, const char *item, time_t now)
time_t download_status_get_next_attempt_at(const download_status_t *dls)
time_t download_status_increment_failure(download_status_t *dls, int status_code, const char *item, int server, time_t now)
void download_status_mark_impossible(download_status_t *dl)
void download_status_reset(download_status_t *dls)