summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* circmgr:Resolve a warning when building without ntor-v3Nick Mathewson2023-12-131-2/+3
|
* Fix a clippy lintIan Jackson2023-12-121-1/+1
| | | | | | | | | | warning: consider adding a `;` to the last statement for consistent formatting --> crates/tor-circmgr/src/build.rs:162:13 | 162 | handshake_res = circ.create_firsthop_ntor(ct, params).await | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `handshake_res = circ.create_firsthop_ntor(ct, params).await;` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
* ClientCir: use ntor_v3 handshake when target supports itJim Newsome2023-12-071-18/+50
|
* Downgrade some messages to traceIan Jackson2023-11-292-3/+3
| | | | | These messages are very verbose and I doubt anyone will want them, usually, even when debugging.
* tor-circmgr: panic instead in order to return ErrorSaksham Mittal2023-11-211-1/+1
|
* tor-circmgr: port run_builder_test() to use spawn_join()Saksham Mittal2023-11-211-10/+4
|
* tor-circmgr: partially port mgr tests to MockRuntimeSaksham Mittal2023-11-141-11/+11
| | | | | | MockSleepRuntime wraps a MockRuntime instead of using test_with_one_runtime!(), so the tests should be more deterministic
* tor-circmgr: partially port test_double_timeout() to MockRuntimeSaksham Mittal2023-11-141-6/+3
| | | | | | | | The tests still use MockSleepRuntime for the more complicated tests where we forcefully make one or both futures time out, but MockSleepRuntime wraps a MockRuntime instead of using test_with_all_runtimes!(), so the tests should be more deterministic
* tor-circmgr: fix build_*_timeout() for MockRuntime portSaksham Mittal2023-11-141-8/+5
| | | | | The funky thing was getting rid of the Canceled error from the channel and returning the actual error from build_owned() properly
* tor-circmgr: have FakeCirc derive DebugSaksham Mittal2023-11-111-5/+2
|
* tor-circmgr: Port some build_* tests to MockRuntimeSaksham Mittal2023-11-111-15/+27
| | | | build_modest_timeout() and build_huge_timeout() don't pass yet
* AbstractCircMgr::get_or_launch: inline wait_for_circJim Newsome2023-10-251-2/+1
|
* AbstractCircMgr::get_or_launch: document MSRV where div_ceil was stabilizedJim Newsome2023-10-251-1/+2
|
* Fix out of date commenthalcyon2023-10-201-2/+1
|
* oneshot: Apply deferred rustfmt churnIan Jackson2023-10-112-2/+2
| | | | cargo fmt, precisely.
* oneshot: Use veneer in tor-circmgrIan Jackson2023-10-113-5/+6
|
* arti-client: add exit selection with GeoIP country codeseta2023-09-186-9/+176
| | | | | | | | | | | | | | | | | | | | This threads the country codes work through the rest of the codebase: - `tor-dirmgr` will now enable GeoIP with the embedded database when the `geoip` future is enabled - This can be extended later using the `DirMgrConfig` to allow specifying a custom database; this is not done here, though - `tor-circmgr`'s `SupportedCircUsage` and `TargetCircUsage` fields gain new `country_code` members to allow filtering circuits by country - These are `()` in builds where the `geoip` feature is not enabled -- doing it this way means we don't have to copy and paste huge swathes of code, since we can't use `#[cfg]` in patterns - `ExitPathBuilder` gains (hacked-in) support for choosing a relay with the correct country code - Due to the lack of conjuction, we just copy and paste a small bit, pending further refactoring - `StreamPrefs` now lets you specify a country code, letting embedders make use of the feature
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-2312-0/+12
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* tor-circmgr: impl AsRef<dyn std::error::Error> for some error typesIan Jackson2023-07-181-0/+3
| | | | We're about to want this.
* Merge branch 'clippy-allow' into 'main'Ian Jackson2023-07-1112-0/+13
|\ | | | | | | | | clippy: Allow some of our existing code patterns See merge request tpo/core/arti!1396
| * Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-1012-0/+13
| |
* | rng ranges: Use gen_range_infallible() for Duration::ZERO..=TIan Jackson2023-07-101-1/+1
| |
* | rng ranges: Use gen_range_checked().unwrap() in test caseIan Jackson2023-07-101-2/+2
| | | | | | | | | | | | Ideally we would be allowed to use vanilla gen_range() here, but there doesn't seem to be a way to allow a specific clippy-forbidden method using #[allow] and we probably don't want to make a blanket allow.
* | rng ranges: Use gen_range_checked().expect() in obvious cases (fmt)Ian Jackson2023-07-101-1/+2
| |
* | rng ranges: Use gen_range_checked().expect() in obvious casesIan Jackson2023-07-102-3/+6
|/ | | | In each of these, it is locally obvious that the range is nonempty.
* Merge branch 'inclusive' into 'main'Nick Mathewson2023-07-071-1/+1
|\ | | | | | | | | rng ranges: Use inclusive Duration ranges in several places See merge request tpo/core/arti!1385
| * rng ranges: Use inclusive Duration ranges in several placesIan Jackson2023-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Many of these call sites would panic if, somehow, the upper bound was zero. In most cases it is very complicated to see if whether this could happen. However, there is a better answer: Durations are (conceptually) dense, so picking the closed set (which includes its boundary) rather than the open one (which doesn't) will make little practical difference. So change four call sites to use `..=` instead of just `..`.
* | Merge branch 'report-bugs-v2' into 'main'Nick Mathewson2023-07-075-42/+29
|\ \ | |/ |/| | | | | Optional tracing support in tor-error for error reporting See merge request tpo/core/arti!1379
| * circmgr: Use event_report!() and similar macrosNick Mathewson2023-07-075-42/+29
| | | | | | | | This simplifies our logging a little, and implements part of
* | Merge branch 'allow_missing_panics' into 'main'Ian Jackson2023-07-071-1/+0
|\ \ | | | | | | | | | | | | | | | | | | add_warning: Tolerate clippy::missing_panics_doc Closes #950 See merge request tpo/core/arti!1380
| * | Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| |/ | | | | | | Closes #950.
* / Avoid matches!(x, None), matches!(x, Ok(_))Nick Mathewson2023-07-061-1/+1
|/ | | | This appeases clippy-nightly.
* tor-circmgr: Provide estimate_timeout as a method on HsCircPoolIan Jackson2023-06-291-1/+21
|
* Merge branch 'circparams' into 'main'Ian Jackson2023-06-292-15/+18
|\ | | | | | | | | | | | | tor-hsclient: Use proper CircParameters Closes #935 See merge request tpo/core/arti!1340
| * tor-circmgr: Expose CircParameters from NetParameters constructionIan Jackson2023-06-292-15/+18
| | | | | | | | | | | | | | | | As per #935. I called this "circparameters_from_netparameters" not "circparameters_from_netparams" because the type is "NetParameters" not "NetParams".
* | circmgr: Refactor duplicate logic.Nick Mathewson2023-06-281-27/+21
| | | | | | | | | | These two functions are only slightly different, and benefit from taking a Fn.
* | circmgr: Remove a "TODO HS" about path restrictions.Nick Mathewson2023-06-281-3/+0
| | | | | | | | | | I looked through the C tor source code and couldn't find any additional path restrictions.
* | circmgr: Defer two "TODO HS" in hspoolNick Mathewson2023-06-281-2/+2
|/ | | | One of these is test-related; one is vanguards-related.
* HS configuration: Add retry parameters to configurationIan Jackson2023-06-281-0/+36
| | | | | | | I think these should go in `[circuit_timing]`. That section already has some retry parameters, so is not strictly *timing*. This is not honoured yet.
* random_idx_where: Ensure uniform distribution of choiceJim Newsome2023-06-231-22/+32
| | | | | Previously, this was more likely to select elements that occurred after other elements that didn't satisfy the predicate.
* Add more tests for random_idx_whereJim Newsome2023-06-231-0/+10
|
* Merge branch 'idx' into 'main'Ian Jackson2023-06-231-0/+10
|\ | | | | | | | | | | | | tor-circmgr: Fix random_idx_where with empty slice Closes #918 See merge request tpo/core/arti!1296
| * tor-circmgr: Test random_idx_where with empty sliceIan Jackson2023-06-231-0/+7
| | | | | | | | | | I have verified that this test fails, as expected, when applied without the corresponding bugfix.
| * tor-circmgr: random_idx_where: Don't panic on empty rangeIan Jackson2023-06-231-0/+3
| | | | | | | | Fixes #918.
* | Merge branch 'circmgr-timeout-est' into 'main'Nick Mathewson2023-06-223-7/+34
|\ \ | | | | | | | | | | | | circmgr: New API to expose estimate-based timeouts. See merge request tpo/core/arti!1281
| * | circmgr: Now that Action is public, clean it up a little.Nick Mathewson2023-06-221-3/+2
| | |
| * | circmgr: New API to expose estimate-based timeouts.Nick Mathewson2023-06-223-4/+32
| | | | | | | | | | | | | | | This will help create good timeout values for various onion-service operations.
* | | hspool: Use let-else pattern; our MSRV permits it.Nick Mathewson2023-06-221-6/+2
| | |
* | | circmgr: Use path_ref() instead of path().Nick Mathewson2023-06-221-24/+45
| |/ |/|