aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/mgr.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-151-1/+0
|
* Removed unnecessary lintpryty262026-07-151-1/+1
| | | | Removed unnecessary lint
* 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.
* circmgr: Port to web-time-compat.Nick Mathewson2026-03-261-2/+3
|
* Force use of standard hasher with weak_tables.Nick Mathewson2026-03-241-2/+8
| | | | | | | | | | | | | Closes #2418. Fixes TROVE-2026-005, where we would use a less cryptographically secure (and probably less DoS resistant) hash function for these tables if: - We are built alongside another crate that uses `weak-table` - That crate enables the `weak-table/ahash` feature. - We are running on a system without hardware AES. Severity: Low
* circmgr: Make test helper non-async (fmt)Gabriela Moldovan2026-01-281-5/+1
|
* circmgr: Make test helper non-asyncGabriela Moldovan2026-01-281-9/+9
|
* fix: preserve timestamps when flattening RetryErrorsNihal2025-12-171-7/+1
|
* fix: use wallclock timestamps in all push_timed callsNihal2025-12-171-22/+22
|
* fix: semver labels and extend() with push_timed loopNihal2025-12-171-3/+6
|
* refactor: convert Extend to inherent method, forbid push/extend, fix ↵Nihal2025-12-171-0/+2
| | | | rend_handshake time
* refactor: clean codeNihal2025-12-171-4/+4
|
* feat(retry-error): add timestamps to retry errorsNihal2025-12-171-7/+26
|
* circmgr: Add missing docs for RestrictionFailedGabriela Moldovan2025-12-011-0/+1
|
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-241-2/+13
| | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* circmgr: report errors from update_long_lived_tunnel_last_usedNick Mathewson2025-11-121-21/+54
| | | | | (The only error possible is an internal error from calling it with a non-long-lived tunnel.)
* circmgr: In expiration task, try again if we are not yet ready to expire.Nick Mathewson2025-11-121-21/+31
|
* circmgr: Add a timeout setting for long-lived circuits.Nick Mathewson2025-11-121-1/+2
|
* circmgr: Implement expiration for long-lived tunnels.Nick Mathewson2025-11-121-21/+217
| | | | | | | | | | | | | | | | | 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: Add a notion of long-lived tunnels.Nick Mathewson2025-11-121-8/+45
|
* circmgr: Refactor should_expire()Nick Mathewson2025-11-121-24/+40
| | | | | Instead of a series of cutoffs, take an object with a set of lifetimes.
* circmgr: make expiration functions asyncNick Mathewson2025-11-121-23/+18
| | | | We'll need them to be async so they can call disused_since() on tunnels.
* circmgr: rename expire_tunnel to consider_expiring_tunnelNick Mathewson2025-11-121-3/+7
|
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | 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
|
* 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-9/+5
| | | | | | | | | | | | | | 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.
* conflux: Adjust docs and fix doc links.Gabriela Moldovan2025-08-051-12/+12
|
* proto: abolish path_ref() in favor of all_paths().Gabriela Moldovan2025-08-051-6/+3
| | | | | | | | | | | | | Until now, we've been using `ClientCirc::path_ref()` to get the *only* path of a circuit. Now that `ClientCirc` is a handle to a tunnel reactor (which may or may not be multi-path), we need to decide for each call site of `path_ref()`, if we actually want *all* paths in the tunnel, or if we expect the tunnel to be single-path and thus want the *only* path in the tunnel. I've added two new APIs to address this: `all_paths()`, for getting all the paths in the tunnel, and `single_path()` for getting the only path in the tunnel, or an error if the tunnel is single-path.
* circmgr: Add back cognitive_complexity allows.Gabriela Moldovan2025-08-051-0/+1
| | | | | These were removed somewhere along the way (which is now causing the clippy checks to fail).
* circmgr: Fix unit testsDavid Goulet2025-08-051-12/+12
| | | | Signed-off-by: David Goulet <[email protected]>
* hs: Use the new Tunnel interface for onion serviceDavid Goulet2025-08-051-1/+1
|
* tunnel: Implement Buildable for ClientTunnelDavid Goulet2025-08-051-10/+7
| | | | | | | | | | | | 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-446/+457
| | | | | | | | | | | | 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]>
* tor-circmgr: Reduced dependency on `once_cell`hashcatHitman2025-06-141-2/+2
| | | | | | - Replaced `once_cell::sync::Lazy` with `std::sync::LazyLock`. Signed-off-by: hashcatHitman <[email protected]>
* tor-circmgr: fix docs failureSteven Engler2025-06-091-2/+2
|
* *: 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.
* tor-proto: Update the TunnelMutableState when a circuit is removed.Gabriela Moldovan2025-05-151-2/+6
| | | | | | | | This is messy, because `ClientCirc::{path_ref, n_hops, ..}` become fallible (we can't unwrap the result, because when a circuit is closed, its state gets removed from the `TunnelSharedState`, but its `ClientCirc` handle continues to exist, so any attempt to retrieve the state will result in an `Err`).
* circmgr: Rename AbstractCirc::{extend_ntor => extend}Nick Mathewson2025-04-281-2/+2
| | | | | We don't want to be thinking about ntor vs ntor3 in circmgr.
* circ: Remove CircParameters reference in call stackDavid Goulet2025-04-231-1/+1
| | | | | | | | | | | This avoids cloning the object and instead allows us to have a CircParameters per hop on the circuit path. This will come handy with congestion control where each hop might have different congestion control parameters. Part of #1817 Signed-off-by: David Goulet <[email protected]>
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | - Several methods have been moved out of SliceRandom.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-3/+3
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* tor-rtmock: allow-Decorate every use of MockSleepProviderIan Jackson2025-03-061-1/+16
| | | | | | | MockSleepProvider and MockSleepRuntime have been declared deprecated by the docs for some time. We're about to mark them `#[deprecated]`. This commit has been split out for clarity of review.
* Resolve clippy::empty_line_after_doc_comments warnings.Nick Mathewson2024-12-031-1/+2
| | | | These are new in Rust 1.83.
* Introduce mpsc_channel_no_memquota and use it in the places it's wantedIan Jackson2024-10-151-1/+6
| | | | | These are the call sites where using this fucntion is correct. (Outside tor-rtmock, which we'll do separately.)
* Merge branch 'div_ceil' into 'main'Nick Mathewson2024-10-031-14/+1
|\ | | | | | | | | Use {u64,usize}::div_ceil See merge request tpo/core/arti!2473
| * Use {u64,usize}::div_ceilNick Mathewson2024-09-301-14/+1
| | | | | | | | | | Previously we had to avoid it, but now that our MSRV is above 1.73 we can use it with abandon.
* | CircMgr: Start writing tests.Wesley Aptekar-Cassels2024-10-031-12/+35
|/