Tor  0.4.7.0-alpha-dev
Data Fields
download_status_t Struct Reference

#include <download_status_st.h>

Data Fields

time_t next_attempt_at
 
uint8_t n_download_failures
 
uint8_t n_download_attempts
 
download_schedule_bitfield_t schedule: 8
 
download_want_authority_bitfield_t want_authority: 1
 
download_schedule_increment_bitfield_t increment_on: 1
 
uint8_t last_backoff_position
 
int last_delay_used
 

Detailed Description

Information about our plans for retrying downloads for a downloadable directory object. Each type of downloadable directory object has a corresponding retry schedule, which can be different depending on whether the object is being downloaded from an authority or a mirror (want_authority). next_attempt_at contains the next time we will attempt to download the object. For schedules that increment_on failure, n_download_failures is used to determine the position in the schedule. (Each schedule is a smartlist of integer delays, parsed from a CSV option.) Every time a connection attempt fails, n_download_failures is incremented, the new delay value is looked up from the schedule, and next_attempt_at is set delay seconds from the time the previous connection failed. Therefore, at most one failure-based connection can be in progress for each download_status_t. For schedules that increment_on attempt, n_download_attempts is used to determine the position in the schedule. Every time a connection attempt is made, n_download_attempts is incremented, the new delay value is looked up from the schedule, and next_attempt_at is set delay seconds from the time the previous connection was attempted. Therefore, multiple concurrent attempted-based connections can be in progress for each download_status_t. After an object is successfully downloaded, any other concurrent connections are terminated. A new schedule which starts at position 0 is used for subsequent downloads of the same object.

Definition at line 41 of file download_status_st.h.

Field Documentation

◆ increment_on

download_schedule_increment_bitfield_t increment_on

does this schedule increment on each attempt, or after each failure?

Definition at line 58 of file download_status_st.h.

Referenced by download_status_increment_attempt(), download_status_increment_failure(), and download_status_schedule_get_delay().

◆ last_backoff_position

uint8_t last_backoff_position

number of attempts/failures, depending on increment_on, when we last recalculated the delay. Only updated if backoff == 1.

Definition at line 61 of file download_status_st.h.

◆ last_delay_used

int last_delay_used

last delay used for random exponential backoff; only updated if backoff == 1

Definition at line 65 of file download_status_st.h.

◆ n_download_attempts

uint8_t n_download_attempts

Number of (potentially concurrent) attempts to download the most recent object, since the last success.

Definition at line 46 of file download_status_st.h.

Referenced by download_status_get_n_attempts(), download_status_mark_impossible(), and download_status_reset().

◆ n_download_failures

uint8_t n_download_failures

Number of failed downloads of the most recent object, since the last success.

Definition at line 44 of file download_status_st.h.

Referenced by download_status_get_n_failures(), download_status_increment_failure(), download_status_mark_impossible(), and download_status_reset().

◆ next_attempt_at

time_t next_attempt_at

◆ schedule

download_schedule_bitfield_t schedule

What kind of object is being downloaded? This determines the schedule used for the download.

Definition at line 49 of file download_status_st.h.

Referenced by download_status_cert_init(), find_dl_min_delay(), and update_consensus_bootstrap_attempt_downloads().

◆ want_authority

download_want_authority_bitfield_t want_authority

Is the download happening from an authority or a mirror? This determines the schedule used for the download.

Definition at line 53 of file download_status_st.h.


The documentation for this struct was generated from the following file: