aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr/src
Commit message (Collapse)AuthorAgeFilesLines
...
* bridge descriptors: logging: Log addition and removal (fmt)Ian Jackson2022-11-031-12/+20
| | | | Worsify formatting as demanded by rustfmt.
* bridge descriptors: logging: Log addition and removalIan Jackson2022-11-031-8/+31
| | | | | This involves breaking the calls to `new_bridges.remove` into a helper that does the logging.
* bridge descriptors: logging: Log download start and outcomeIan Jackson2022-11-031-0/+6
|
* bridge descriptors tests: Test set_bridges more thoroughlyIan Jackson2022-11-031-0/+34
| | | | | | | | Prior to the previous commit, set_bridges would malfunction if there were bridges which where (i) in current (ii) in queued or running (iii) in the new bridge set. This test failed then and passes now.
* bridge descriptors: Rewrite set_bridgesIan Jackson2022-11-031-18/+12
| | | | | | | | This was fundamentally confused and irregular. Now it is more regular: it does the same things to all the elements of Tracked, and a simple filtering on current. This fixes a bug, for which I'm about to add a test case.
* bridge descriptors tests: Add another couple of test casesIan Jackson2022-11-031-1/+31
|
* bridge descriptors tests: stream_drain_ready returns event countIan Jackson2022-11-031-1/+4
| | | | We'll use this in a moment.
* bridge descriptors tests: Break out bad_bridge helper functionIan Jackson2022-11-031-7/+7
|
* bridge descriptors: Change default max_refetchIan Jackson2022-11-032-2/+2
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/820#note_2850269
* bridge descriptors: Add clarification about bridge statesIan Jackson2022-11-031-0/+3
|
* bridge descriptors: Improve and fix docs for consider_launchingIan Jackson2022-11-031-1/+6
|
* bridge descriptors: Add comments where StateGuard is droppedIan Jackson2022-11-031-0/+8
|
* bridge descriptors: Document `changed` and `earliest_timeout` OptionsIan Jackson2022-11-031-0/+5
|
* bridge descriptors: Document updates argument to timeout_taskIan Jackson2022-11-031-0/+6
|
* bridge descriptors: TestsIan Jackson2022-11-032-0/+267
|
* bridge descriptors: Provide a consistency check functionIan Jackson2022-11-031-0/+196
| | | | | This is really part of the tests, but I put it here so that it can be compiled-in if someone wants it during debugging.
* bridge descriptors: Provide an implementation of BridgeDescProviderIan Jackson2022-11-032-0/+1097
| | | | Tests will come in a moment.
* tor-dirmgr: impl Default for FlagPublisherIan Jackson2022-10-271-0/+6
|
* tor-dirmgr: impl FlagEvent for BridgeDescEventIan Jackson2022-10-271-0/+6
|
* Fix clippy false positiveIan Jackson2022-10-251-0/+5
|
* FlagEvent trait: Implement using macrosIan Jackson2022-10-252-14/+62
| | | | | | | | | | | 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.
* tor-dirclient: Make RequestFailed its own error typeIan Jackson2022-10-201-5/+5
| | | | | | | We're going to have functions on Response that fail by returning only one of these. Sadly this diff is quite noisy.
* tor-dirclient Response: Rename output methodsIan Jackson2022-10-201-1/+1
| | | | | These don't check errors and are therefore quite hazardous. I'm going to introduce a more cooked version in a moment.
* 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
|
* fix clippy::needless_borrowtrinity-1686a2022-09-101-1/+1
|
* fix clippy::unwrap_used and old TODO for msrv 1.56trinity-1686a2022-09-101-9/+6
|
* `TaskSchedule`: give error on `sleep*()` if last handle is droppedNick Mathewson2022-09-073-4/+14
| | | | | | | | | | | | | | | | | | 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.
* Use anonymize_home() when displaying various messages.Nick Mathewson2022-08-311-1/+2
| | | | Closes #555
* add feature annotation not added by doc_auto_cfgtrinity-1686a2022-08-241-0/+1
|
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-241-0/+1
|
* Decrease the lifetimes for storing descriptors.Nick Mathewson2022-08-091-6/+29
| | | | | | | These values were chosen experimentally, based on those from Tor, to save disk space without wasting much bandwidth. Closes #527.
* 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-262-11/+8
| | | | 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-223-9/+15
| | | | | | 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.
* Merge branch 'dirmgr_error_cleanup' into 'main'Nick Mathewson2022-07-183-61/+84
|\ | | | | | | | | | | | | Clean up some errors in tor-dirmgr Closes #521 See merge request tpo/core/arti!628
| * dirmgr: Add a helper to create LockFile errors.Nick Mathewson2022-07-182-8/+9
| |
| * dirmgr: Make UnrecognizedSchema more helpfulNick Mathewson2022-07-142-6/+14
| |
| * dirmgr: Add an instance of BadUtf8InCacheNick Mathewson2022-07-141-2/+1
| |
| * dirmgr: Clarify disk IO errors.Nick Mathewson2022-07-143-33/+48
| |
| * dirmgr: style edits to error messages.Nick Mathewson2022-07-141-22/+22
| |
* | Fix illegal formatting in cache filenamesfeelingnothing2022-07-141-1/+1
|/
* Merge branch 'clippy' into 'main'Ian Jackson2022-06-241-0/+3
|\ | | | | | | | | Fix clippy nightly again See merge request tpo/core/arti!603
| * Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | | | | | Update all lint blocks
* | Merge branch 'dirmgr' into 'main'Nick Mathewson2022-06-241-53/+49
|\ \ | | | | | | | | | | | | | | | | | | dirmgr: followups to !587, mostly using iterators Closes #468 See merge request tpo/core/arti!599
| * | dirmgr: Use ... .find().is_none() rather than clippy's suggestionIan Jackson2022-06-231-2/+4
| | |