summaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* dirmgr: Use contains_key in check.Nick Mathewson2024-04-221-1/+1
|
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* tor-dirmgr: Simplify a clone call (fmt)Ian Jackson2024-01-311-3/+1
|
* tor-dirmgr: Simplify a clone callIan Jackson2024-01-311-2/+1
| | | | Prompted by clippy.
* tor-dirmgr: Rename DirMgrConfig.cache_path to cache_dirIan Jackson2023-12-041-3/+3
| | | | | | This variable contains precisely the value of cache_dir from arti_client::config::StorageConfig and it should therefore have the same name.
* oneshot: Use veneer in tor-dirmgrIan Jackson2023-10-111-1/+2
|
* Add cognitive-complexity exceptions for clippy.Nick Mathewson2023-09-051-0/+1
| | | | I have no idea why these became necessary.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+2
|
* Throughout: Use *_report!() macros for reporting Errors.Nick Mathewson2023-07-071-10/+7
| | | | | | | | | | | | | | | I identified the cases to replace by searching for the string `.report()`. There are a few that I didn't change: * A couple of cases that used anyhow::Error, * One case that reported two Errors. * Two cases in `tor_hsclient::err` that just did `error!("Bug: {}")`. I have also not audited the cases in `tor-hsclient` where we're using `tor_error::Report` manually. Nonetheless, closes #949.
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | Closes #950.
* lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|
* DirMgr: More logs in top-level bootstrapping code.Nick Mathewson2023-05-031-5/+12
| | | | Closes #803, I hope.
* DirMgr: Log at trace! when starting a new "AttemptId".Nick Mathewson2023-05-031-1/+7
|
* tor-dirmgr: Don't try to mark consensus usable in a read-only store.Nick Mathewson2023-03-081-4/+6
| | | | | | | | | | | Doing this means that any attempt to use a read-only store would crash as soon as it found that the consensus was usable. It seems that this bug was introduced at some point doing all the dirmgr refactors we did over the past year. Perhaps there should be a test for running with a read-only store. Fixes #779
* Use ErrorReport - run rustfmtIan Jackson2023-01-301-2/+6
| | | | Split off for ease of review and possible rebase.
* Use ErrorReport for errors in warn! in tor-dirmgrIan Jackson2023-01-301-3/+3
|
* Use ErrorReport for errors in info! in tor-dirmgrIan Jackson2023-01-301-2/+2
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+8
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* dirmgr: Spelling fixes and normali[sz]ationsNick Mathewson2022-12-061-1/+1
|
* Fix a couple of rustdoc issues.Nick Mathewson2022-11-181-1/+2
| | | | These slipped in while nightly was broken.
* dirmgr Store: Have constructors take DirMgrStoreIan Jackson2022-11-141-6/+13
| | | | | | | Now the Store is constructed by arti_client, solving the problem described here https://gitlab.torproject.org/tpo/core/arti/-/issues/631#note_2853665 but in a different way.
* dirmgr Store: Introduce DirMgrStore and use for BridgeDescMgrIan Jackson2022-11-141-0/+25
| | | | We are going to change DirMgr's constructors to also take a DirMgrStore.
* dirmgr Store: Use `**` syntax and deref to trait objectsIan Jackson2022-11-141-23/+14
| | | | This will allow us to get rid of a needless trait impl.
* bridge desc: Drop a done TODOIan Jackson2022-11-081-1/+0
| | | | | We have a separate BridgeDescMgr, rather than reusing DirMgr, so we will not be implementing BridgeDescProvider for DirMgr.
* dirmgr: Make store be in an ArcIan Jackson2022-11-041-2/+2
| | | | | This will let us share it with the bridge descriptor manager. (As discussed with Nick.)
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* bridge descriptors: Provide an implementation of BridgeDescProviderIan Jackson2022-11-031-0/+2
| | | | Tests will come in a moment.
* Fix clippy false positiveIan Jackson2022-10-251-0/+5
|
* FlagEvent trait: Implement using macrosIan Jackson2022-10-251-0/+3
| | | | | | | | | | | The explicit list of variant names, that needs to be kept in sync, and is a test failure semver break hazard, is now gone. All the necessary code is now generated automatically, and cannot be wrong. I want this because I find myself wanting to add a second implementation of FlagEvent, for another type.
* cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-51/+1
| | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* Mark all bridge and pt features as experimental for now.Nick Mathewson2022-09-291-0/+26
| | | | | | Also, document the features. Closes #588.
* GuardMgr/DirMgr: Add APIs for bridge descriptor listsNick Mathewson2022-09-261-0/+1
|
* `TaskSchedule`: give error on `sleep*()` if last handle is droppedNick Mathewson2022-09-071-3/+3
| | | | | | | | | | | | | | | | | | This fixes an busy-loop. When the last `TaskHandle` on a `TaskSchedule` is dropped, the schedule is permanently canceled: whatever operation it was scheduling should no longer be performed. But our code was broken: the `sleep()` and `sleep_until_wallclock()` functions don't verify whether the handles are dropped or not. This breakage caused an CPU-eating busy-loop in `sleep_until_wallclock`. With this patch, we now return a `Result<(), SleepError>` from these functions. Fixes #572.
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-241-0/+1
|
* Finish implementation of params() for DirMgr.Nick Mathewson2022-08-021-0/+36
| | | | | | | Now it maintains an up-to-date set of default parameters to be handed out if there is no directory. Closes #528.
* tor-dirmgr: Remove opt_netdir entirely.Nick Mathewson2022-07-261-8/+5
| | | | Its existence tended to hide bugs, and was just asking for trouble.
* Remove unused DirMgr::netdir method, make opt_netdir private.Nick Mathewson2022-07-261-11/+1
|
* Add new APIs to NetDirProvider to better support timeliness.Nick Mathewson2022-07-261-3/+24
| | | | | | | | | | | | | | | | | Over the years we've found that most callers who want a netdir want what C Tor calls a "reasonably live" network directory: One that is not expired by too much, or too far in the future. But a few want a _strictly_ live directory: one that says it is valid now, with no tolerances. And a few want _any_ directory, no matter how expired it is. This commit adds net methods to NetDirProvider to provide these directories. I think that most use cases will want to explicitly think about what kind of directory they want, so I've made `netdir` the simplest method. I might remove `timely_netdir` by the end of this branch; see TODO comments. Part of #518.
* Rename DirSkewTolerance to DirToleranceNick Mathewson2022-07-221-3/+3
| | | | | | This name is more accurate because we aren't only dealing with clock skew here: we're also trying to tolerate the case where the authorities fail to reach consensus for a while.
* Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | Update all lint blocks
* Merge branch 'stalled_directory' into 'main'Ian Jackson2022-06-211-14/+51
|\ | | | | | | | | | | | | Detect and report stalled directory downloads Closes #468 See merge request tpo/core/arti!587
| * tor-dirmgr: Make DirStatus non-public.Nick Mathewson2022-06-141-1/+1
| | | | | | | | | | I believe this type was made public in error: No other crate uses it, and no API exposes it.
| * Add a blockage-reporting mechanism to tor-dirmgr.Nick Mathewson2022-06-141-1/+1
| | | | | | | | | | | | | | | | | | The `DirBootstrapStatus` type now exposes a blockage() method to return an `Option<DirBlockage>`. The blockage types reported are more low-level than I'd like, but they are IMO good enough for now: we'll want to get experience with actual vs hypothetical problems before we refine them.