#ifndef TOR_DLSTATUS_H
#define TOR_DLSTATUS_H
time_t download_status_increment_failure(download_status_t *dls,
int status_code, const char *item,
int server, time_t now);
time_t download_status_increment_attempt(download_status_t *dls,
const char *item, time_t now);
#define download_status_failed(dls, sc) \
download_status_increment_failure((dls), (sc), NULL, \
dir_server_mode(get_options()), \
time(NULL))
void download_status_reset(download_status_t *dls);
int download_status_is_ready(download_status_t *dls, time_t now);
time_t download_status_get_next_attempt_at(const download_status_t *dls);
void 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);
#ifdef DLSTATUS_PRIVATE
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);
STATIC void next_random_exponential_delay_range(int *low_bound_out,
int *high_bound_out,
int delay,
int base_delay);
#define DIR_DEFAULT_RANDOM_MULTIPLIER (3)
#define DIR_TEST_NET_RANDOM_MULTIPLIER (2)
#endif
#endif