aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-151-2/+0
|
* add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
|
* Removed unnecessary lintpryty262026-07-151-1/+1
| | | | Removed unnecessary lint
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+2
| | | | | | | | | | | | 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.
* Log tunnel and circuit IDsJim Newsome2026-04-081-4/+8
|
* Fix log typo PreeemptiveJim Newsome2026-04-081-1/+1
|
* circmgr: Use runtime.now() in place of Instant/SystemTime::get().Nick Mathewson2026-03-311-3/+2
| | | | Part of #2428.
* circmgr: Port to web-time-compat.Nick Mathewson2026-03-261-2/+3
|
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* Remove unnecessary `doc(cfg(...))` attributesNeel Chauhan2025-12-041-3/+0
| | | | | | | | | Fixes part of #2193. (Edits from nickm: I selected the cases here that I could verify were correct from immediate context.) Edited-by: Nick Mathewson <[email protected]>
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-241-1/+17
| | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* circmgr: Implement expiration for long-lived tunnels.Nick Mathewson2025-11-121-1/+3
| | | | | | | | | | | | | | | | | This code uses the algorithm of prop368: When a tunnel is sufficiently isolated, we want to expire it after it has been disused for a certain amount of time. The implementation is a little tricky, since we need to call an async function on ClientTunnel to look up the disused_since() check. We don't want to call async functions while holding locks, so we need to drop the TunnelList lock before we do the disused_since() calls, and the grab it again. As part of this change, I've had made expiration functions return the earliest time at which any tunnel might expire. We can use this in the future to spawn fewer expiration tasks, and scan the list of tunnels less often.
* circmgr: make expiration functions asyncNick Mathewson2025-11-121-8/+11
| | | | We'll need them to be async so they can call disused_since() on tunnels.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-2/+2
| | | | Run maint/add_warning
* all: run cargo fmtSteven Engler2025-11-041-1/+1
|
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-041-1/+1
|
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* Move `FallbackDir` into `tor-dircommon`Clara Engler2025-09-111-1/+1
|
* proto: Add a circuit module shared between client and relay impls.Gabriela Moldovan2025-08-281-1/+2
| | | | | | | This is just code motion (I suggest reviewing with `--color-moved`). This also moves the implementation-agnostic parts from `tor_proto::client::circuit` to a new `tor_proto::circuit` module.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | 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.
* circmgr: Feature gate multi path tunnel with conflux flagDavid Goulet2025-08-051-5/+9
| | | | Signed-off-by: David Goulet <[email protected]>
* Revert "circmgr: Feature-gate all the onion service tunnel types."Gabriela Moldovan2025-08-051-13/+1
| | | | This reverts commit 9dca6010d17e2a4b9deee34c9bb66e523a6ac834.
* circmgr: Feature-gate all the onion service tunnel types.Gabriela Moldovan2025-08-051-1/+13
| | | | | We shouldn't be exposing these unless `hs-service`/`hs-client` is enabled.
* hs: Use the new Tunnel interface for onion serviceDavid Goulet2025-08-051-1/+1
|
* circmgr: Return more type specific tunnelDavid Goulet2025-08-051-7/+11
| | | | | | | | | | This is the first step towards making the circmgr return high level tunnel types (wrappers around ClientTunnel). Future commits will then modify each subsystems to use those specific types. They are split in order to reduce complexity. Signed-off-by: David Goulet <[email protected]>
* tunnel: Implement Buildable for ClientTunnelDavid Goulet2025-08-051-6/+6
| | | | | | | | | | | | In order to pull this off, the Arc requirement needs to go away because the Arc<ClientCirc> is now within the ClientTunnel. This commit also has a rename of the CircuitBuilder to TunnelBuilder in order to reflect the change that it now builds a ClientTunnel. There is a slight rename in tor-proto as well just for accuracy. Signed-off-by: David Goulet <[email protected]>
* circmgr: Major rename for the new Tunnel namespaceDavid Goulet2025-08-051-30/+30
| | | | | | | | | | | | The CircMgr will no longer yield circuits but tunnels (src/tunnel.rs). This is a first step to rename most circuit related objects to use "tunnel" instead. Some "circuit" names have been kept for more precise definitions. No behavior changes. Signed-off-by: David Goulet <[email protected]>
* circmgr: New Tunnel object interfaceDavid Goulet2025-08-051-0/+8
| | | | | | | | | | Introduce the new Tunnel structs that is planned to expose publicly as a replacement to `ClientCirc`. Future commits will make those tunnel objects be used accross the code base up until tor-proto which than handles Circuit directly. Signed-off-by: David Goulet <[email protected]>
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* *: suppress cognitive_complexity warnings from nightlyNick Mathewson2025-05-291-0/+2
| | | | | | | | | | | | | Apparently clippy nightly is better (or worse?) about detecting complex functions than before, so I'm suppressing these warnings where they occur. I have mixed feelings about these warnings: On the plus side, they really do help to detect functions that are twistier than they need to be. On the minus side, they get confused by tracing macros, and the "allows" do pile up. But on the plus side, those "allows" do provide a way to find functions that need to be refactored, and they are never uglier than the functions they decorate.
* circmgr: Propagate Option<HsCircKind> down to path selection functionsNick Mathewson2025-05-201-5/+12
| | | | | | We'll need this in order to build paths that are specifically for client rend circuits. I thought of using a boolean here, but that had potential to get ugly in the future.
* circmgr: Make path module public on "--features=experimental-api"Nick Mathewson2025-05-051-1/+9
| | | | | | | | | | | | Back in 4c1eb94173521bc5104449327650e20ffe32afa7, for sensible reasons, we made `tor_circmgr::path` a crate-private module. But when we did that, we lost the ability for callers to construct circuits with custom paths. This will make it possible for callers to build custom circuits again, without committing to a very-long-term API for that. Closes #1981.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* circmgr: Remove the CircParameters build .expect()David Goulet2025-01-161-4/+4
| | | | | | Instead, return an error and make all call site handle it. Signed-off-by: David Goulet <[email protected]>
* circ: Specialize the circparams from netparams functionDavid Goulet2025-01-161-9/+16
| | | | | | | | | | | | | | | Congestion control parameters have specific values depending on the circuit type. Instead of using a CircuitType, which is removed in this commit, specialize the function in this case onion and exit. This allows us to get rid of CircuitType and solely use TargetCircUsage instead. At this commit, we use .expect() on the Builder. Future commit will remove this to return a Result in case of failure. Worth noting that we don't expect one. Signed-off-by: David Goulet <[email protected]>
* circmgr: Modify CircParameters for congestion controlDavid Goulet2025-01-161-13/+10
| | | | | | | | | | | | | | The congestion control parameters are created from the consensus parameters (netparams) and then put into the CircParameters object that is then passed down the tor-proto crate. Because different parameters are selected depending on the circuit type (onion vs exit vs sbws), a CircuitType enum is introduced for the sole purpose of being used to select the right parameters. Related #534 Signed-off-by: David Goulet <[email protected]>
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* tor-circmgr: Rename Short/Extended to Naive/Guarded.Gabriela Moldovan2024-10-241-1/+1
|
* tor-circmgr: s/HsCircStubKind/HsCircStemKind.Gabriela Moldovan2024-10-241-3/+3
| | | | As per #1479
* Disable a lot of dead code warningsIan Jackson2024-10-171-0/+3
| | | | | | | Now cargo check --workspace --no-default-features --all-targets cargo build -p arti --no-default-features --features=memquota,tokio,native-tls are both clean.
* CircMgr: Move note_external_{failure, success} methods to generic impl.Wesley Aptekar-Cassels2024-10-031-27/+27
|
* CircMgr: Move get_or_launch_dir_specific method to generic impl.Wesley Aptekar-Cassels2024-10-031-18/+18
|
* CircMgr: Move get_or_launch_exit method to generic impl.Wesley Aptekar-Cassels2024-10-031-45/+45
|
* CircMgr: Move get_or_launch_dir method to generic impl.Wesley Aptekar-Cassels2024-10-031-8/+8
|
* CircMgr: Move skew_events method to generic impl.Wesley Aptekar-Cassels2024-10-031-11/+11
|
* CircMgr: Move retire_circ method to generic impl.Wesley Aptekar-Cassels2024-10-031-6/+6
|
* CircMgr: Move reconfigure method to generic impl.Wesley Aptekar-Cassels2024-10-031-67/+67
|
* CircMgr: Move retire_all_circuits method to generic impl.Wesley Aptekar-Cassels2024-10-031-11/+11
|