aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr/src/bridgedesc
Commit message (Collapse)AuthorAgeFilesLines
* tor-checkable: TimeBound: Make dangerously_into_parts return TimeRangeIan Jackson2026-07-231-2/+2
| | | | | It is better to return a more cooked type. `TimeRange` aka `TimeRangeBound<()>` is perfect for this.
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* tor-linkspec: Change HasAddrs::addrs to return an IteratorIan Jackson2025-10-061-1/+1
| | | | | | | | This will let us model the actual structure of routerstatus entries in netdocs more closely. They don't have the addresses in a single list. When this code was written this would have been much more awkward, but now we have RPITIT.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-3/+3
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* tor-dirmgr, tor-guardmgr: Use std::slice::from_ref as suggested by clippy.Gabriela Moldovan2025-07-071-4/+4
|
* TimerangeBound: Stop using std::ops::Bound.Wesley Aptekar-Cassels2024-11-251-4/+3
| | | | Fixes: #1691
* Replace _ => panic!() elsewhereIan Jackson2024-10-151-1/+1
|
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* clippy: Replace many calls to .get(0) with .first()Ian Jackson2024-01-021-1/+1
| | | | | FTR I don't think agree with clippy on this question, but then I often don't.
* tor-rtmock: Switch MockRuntime to SimpleMockSleepProviderIan Jackson2023-10-031-7/+7
| | | | | | | | | | | | | | | | For now we do this by changing the meaning of the name `MockSleepProvider` in runtime.rs. This is a bodge to reduce noise in this diff. Consequences at call sites: * If the type is named somehow, the other type must be used. * SimpleMockTimeProvider calls it jump_wallclock rather than jump_to, which is IMO a better name. (MockRuntime will change in a moment.) * SimpleMockTimeProvider's advance() function isn't async and doesn't yield. But none of the call sites actually mind that.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* tor-dirmgr: bridge descriptor tests: Add a missing #[traced_test]Ian Jackson2023-07-061-0/+1
| | | | This seems to have been overlooked.
* tor-dirmgr: bridge descriptor tests: Use MockRuntime (fmt)Ian Jackson2023-07-061-270/+271
| | | | Run rustfmt.
* tor-dirmgr: bridge descriptor tests: Use MockRuntimeIan Jackson2023-07-061-35/+25
| | | | This abolishes a bodge sleep. It should make the tests deterministic.
* tor-dirmgr: bridge descriptor tests: Fix a v. low prob. raceIan Jackson2023-07-061-2/+5
| | | | | | | | | | Drain a number of events, not just one. The stream might yield many events, as explained in this new comment. This fails every time with MockExecutor::try_test_with_various(). I think it might fail with the tokio exeuctor too, but evidently not with high probability or we would have noticed.
* Use bool::then_some() as appropriateNick Mathewson2023-04-111-7/+7
| | | | | | Now that we require a version of Rust that allows `b.then_some(v)`, clippy complains about our use of `b.then(|| v)`.
* Sort out some TODOs in bdtest.rsIan Jackson2023-03-211-5/+4
|
* 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.
* bridge desc mgr: Test dormancyIan Jackson2022-11-231-0/+42
|
* BridgeConfig: Replace all Arc<BridgeConfig> with BridgeConfigIan Jackson2022-11-221-2/+1
| | | | BridgeConfig is itself an Arc now, so these are redundant.
* Fix a bunch of "needless borrow" warnings on nightlyNick Mathewson2022-11-181-1/+1
| | | | | It looks like, despite a few false starts, they've got this warning right; there weren't any false positives.
* bridge descriptor dormancy: Accept the dormancy valueIan Jackson2022-11-111-0/+1
| | | | But right now, don't do anything with it. That will come in a future MR.
* bridge descs: Add tests for process_documentIan Jackson2022-11-081-0/+100
|
* bridge descs: Rename BridgeDescMgr from BridgeDescManagerIan Jackson2022-11-081-2/+2
| | | | | | This is more consistent with our naming elsewhere. Suggested-by: Nick Mathewson <[email protected]>
* bridge desc tests: Test caching and if-modified-sinceIan Jackson2022-11-041-2/+121
|
* bridge desc tests: Break out queues_are_empty helperIan Jackson2022-11-041-2/+6
|
* bridge desc tests: Provide a sqlite connectionIan Jackson2022-11-041-2/+5
| | | | The current test case doesn't use this.
* bridge desc: Provide a Store to the bridge desc managerIan Jackson2022-11-041-5/+10
| | | | | | | | | | | | | | | | We use the one in the dirmgr. That means that our constructor now has to take a dirmgr. And, the dirmgr must have a circmgr. This is all rather odd, TBH. Add .. to the binding of the return values from setup, as future-proofing. The tests now need to provide a Store too. Make the sqlite::new_empty function pub(crate) so we can use it. We must retain the _db_tmp_dir, since when it goes away the tmp directory is deleted and the db goes readonly.
* bridge desc tests: Apply tracing_test::traced_testIan Jackson2022-11-041-0/+2
| | | | This lets us see the log messages. They look fine, as it happens.
* bridgedesc: Prepare Mockable trait for if-modified-sinceIan Jackson2022-11-031-2/+3
|
* bridge descriptors tests: Fix flaky testIan Jackson2022-11-031-1/+11
|
* bridge descriptors tests: Test set_bridges more thoroughly (fix)Ian Jackson2022-11-031-1/+1
| | | | | | The RetryDelays are being triggered for the 2nd time here, so their timeouts can be longer. We must bump the sleep to make sure we don't have a flaky test.
* 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 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-031-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/820#note_2850269
* bridge descriptors: TestsIan Jackson2022-11-031-0/+254