Module tor_dirmgr::bootstrap
source · Expand description
Functions to download or load directory objects, using the
state machines in the states
module.
Macros§
- Given a Result<()>, exit the current function if it is anything other than Ok(), or a nonfatal error.
Structs§
- Identifier for an attempt to bootstrap a directory.
Functions§
- advance 🔒Replace
state
withstate.advance()
. - download 🔒Download information into a DirState state machine until it is “complete”, or until we hit a non-recoverable error.
- Helper: Make a set of download attempts for the current directory state, and on success feed their results into the state object.
- Launch a set of download requests for a set of missing objects in
missing
, and return each request along with the response it received. - Launch a single client request and get an associated response.
- load 🔒Try to load as much state as possible for a provided
state
from the cache indirmgr
, advancing the state to the extent possible. - Load a set of documents from a
Store
, returning all documents found in the store. Note that this may be less than the number of documents inmissing
. - Try to update
state
by loading cached information fromdirmgr
. - Construct an appropriate ClientRequest to download a consensus of the given flavor.
- Construct a set of
ClientRequest
s in order to fetch the documents indocs
. - Helper: Clamp
v
so that it is no more than one week fromnow
. - Record that a problem has occurred because of a failure in an answer from
source
. - Record that
source
has successfully given us some directory info. - If there were errors from a peer in
outcome
, record those errors by marking the circuit (if any) as needing retirement, and noting the peer (if any) as having failed. - reset 🔒Replace
state
withstate.reset()
.