aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr/src/bootstrap.rs
Commit message (Collapse)AuthorAgeFilesLines
* dirmgr: add Store traittharvik2022-02-231-5/+6
|
* dirclient: Remove HttpStatus error variantNick Mathewson2022-02-171-2/+11
| | | | | | | Getting a non-200 status is no longer a failure condition; it's just a different kind of answer. Closes #349.
* dirmgr: eliminate StringParsingError.Nick Mathewson2022-02-161-1/+2
| | | | | | | | It had too many possible Kinds depending on what kind of string had failed to parse. I decided to use #[source] here instead of #[from], so that we would have to explicitly convert these errors where they show up.
* tor-dirmgr: Create a bootstrap-status exporting mechanism.Nick Mathewson2022-01-181-0/+12
| | | | | | | | | | | | | | | | | | | | | | The interface is similar to the one exposed by `arti-client`: it internally uses postage::watch to give a series of events showing when a bootstrap status is changing. Thanks to the existing state/driver separation in the DirMgr design we don't need much new logic: each download state needs to expose (internally) how far along it is in its download, which the bootstrap code passes to the DirMgr if it has changed. I believe that in the long run, we'll probably want to expose more (or different) information here, and we'll want to process it differently. With that in mind, I've made the API for `DirBootstrapStatus` deliberately narrow, so that we can change its of its internal later on without breaking code that depends on it. (The information exposed by this commit is not yet summarized in `arti-client`.) Part of #96.
* Refactor directory events to use a FlagPublisher mechanism.Nick Mathewson2021-12-141-4/+0
| | | | | | | | This approach tries to preserve the current interface, but uses a counter-based event backend to implement a coalescing stream of events that can be represented as small integers. The advantage here is that publishing events no longer needs to be a blocking operation, since there is no queue to fill up.
* Make much of DirMgrConfig reconfigurable.Nick Mathewson2021-12-071-1/+2
| | | | | | | | | | We can't change the authorities while in-flight: that would be pretty miserable to implement. Similarly we can't change the cache while in-flight. Everything else should be fair game, though there are a couple of tricky bits. I've tried to document those.
* add semicolons if nothing returnedDaniel Eades2021-11-251-2/+2
|
* deglob some enums, use concise iteration syntaxDaniel Eades2021-11-251-1/+1
|
* Rename RetryConfig to DownloadSchedule, fold in parallelism.Nick Mathewson2021-11-181-5/+6
|
* Fix typosDimitris Apostolou2021-11-121-2/+2
|
* Remove usage of tracing-test 0.1Nick Mathewson2021-11-111-2/+0
| | | | | | | | It requires tracing-subscriber 0.2, which is a lower version than we want, and which causes trouble with our minimal-versions CI test. There is a pending issue to fix this; we can reinstate tracing-test once it is merged: https://github.com/dbrgn/tracing-test/pull/11
* Tests for tor-dirmgr::bootstrapNick Mathewson2021-11-111-0/+215
|
* Merge branch 'share_state'Nick Mathewson2021-10-211-9/+7
|\
| * Mark consensus as "not-pending" even if its microdescs come from cache.Nick Mathewson2021-10-201-1/+1
| | | | | | | | | | | | | | Previously our code would clear the 'pending' flag on a consensus only when a _downloaded_ md made it become usable. Closes #199.
| * Move tor-dirmgr to use a sync::Mutex.Nick Mathewson2021-10-201-8/+6
| | | | | | | | | | The futures::lock::Mutex was unnecessary, since we never held it when we were suspending.
* | Fix most warnings from nightly.Nick Mathewson2021-10-191-3/+4
|/ | | | (One represents code that I forgot to write.)
* Add a few tracing directives to tor-dirmgr.Nick Mathewson2021-10-131-1/+7
|
* Don't report the bootstrap as completed unless it actually succeeds.Nick Mathewson2021-10-131-1/+4
| | | | | (Previously we'd report it as successful even if the inner download task was a failure.)
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+320
This will cause some pain for now, but now is really the best time to do this kind of thing.