Module tor_dirmgr::state
source · Expand description
Implementation for the primary directory state machine.
There are three (active) states that a download can be in: looking
for a consensus (GetConsensusState
), looking for certificates
to validate that consensus (GetCertsState
), and looking for
microdescriptors (GetMicrodescsState
).
These states have no contact with the network, and are purely
reactive to other code that drives them. See the
bootstrap
module for functions that actually
load or download directory information.
Structs§
- Second state: fetching or loading authority certificates.
- Initial state: fetching or loading a consensus directory.
- Final state: we’re fetching or loading microdescriptors
- A dummy state implementation, used when we need to temporarily write a placeholder into a box.
Enums§
- One of two possible internal states for the consensus in a GetCertsState.
- A change to the currently running
NetDir
, returned by the state machines in this module. - Information about a network directory that might not be ready to become the current network directory.
Traits§
- DirState 🔒A “state” object used to represent our progress in downloading a directory.
- An object that can provide a previous netdir for the bootstrapping state machines to use.
Functions§
- Based on the lifetime for a consensus, return the time range during which clients should fetch the next one.
- If
err
is some, returnErr(err)
. Otherwise return Ok(()). - Choose a random download time to replace a consensus whose lifetime is
lifetime
.