aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/client/circuit.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-proto: fix a `clippy::unnecessary_filter_map`Steven Engler2026-08-111-0/+2
|
* tor-proto: box `CircParameters` in test-only `CtrlCmd::AddFakeHop`Steven Engler2026-08-111-1/+1
| | | | This fixes a `clippy::large_enum_variant`.
* proto: Rename CircId and UniqId variable nameDavid Goulet2026-08-031-3/+3
| | | | | | | | | | | | | | | A CircId is now a circ_id and a UniqId is a unique_id so we stop confusing them in the code. Furthermore, channel_id that are CircId are now circ_id. Channel IDs are different and encoded internally into a UniqId. This is the first step to clarify semantic before we change the logging to log both unique ID and circ ID. No behavior change. Signed-off-by: David Goulet <[email protected]>
* proto: Improve/clarify documentation on extend_virtual.Nick Mathewson2026-07-021-0/+8
|
* 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.
* proto: Update the tests to use the new CircuitRx{Receiver,Sender}sGabriela Moldovan2026-06-081-12/+1
|
* proto: Replace outdated references to RawCellStreamGabriela Moldovan2026-05-281-1/+1
| | | | | `RawCellStream` was removed long ago, in c559754116678866eabe525f5b189b50cc78b5cc.
* tor-proto: clean up `CIRCUIT_BUFFER_SIZE`Steven Engler2026-05-211-4/+0
|
* tor-proto: move more stream queue init to reactorSteven Engler2026-05-211-0/+1
| | | | | | | | | | | | | | | | | | | | Previously when initializing a stream, we constructed most of the stream-related queues outside of the reactor and passed the relevant halves of the queues (senders or receivers) into the reactor. A downside of the above approach is that the reactor may be better informed about what queues to construct, and how to construct them. For example the reactor knows what type of flow control that the hop is using, so it knows whether we need queues for passing rate limits and drain rates for XON/XOFF flow control. This commit moves the construction of these queues into the reactor and passes the relevant halves out of the reactor. In the future we can make better decisions about which queues are needed depending on the flow control method used instead of always constructing them (see arti#2068). Reviewing with `--color-moved` might be helpful as a few lines have been moved.
* proto rpc: Turn tunnel paths into a dictNick Mathewson2026-04-281-0/+13
| | | | | | | | | This will make it possible to tell whether a path has been replaced in the tunnel. Since the UniqId type might change its representation in the future, I've documented that we don't guarantee anything about the strings used to distinguish paths.
* tor-proto: Port to web-time-compatNick Mathewson2026-03-261-2/+3
|
* proto: Move AllowAllStreamsFilter to crate-pub test moduleGabriela Moldovan2026-03-251-15/+3
| | | | This will soon be used by the relay tests too.
* proto: Add option to create RELAY_EARLY via rmsg_to_ccmsg() (fmt)Gabriela Moldovan2026-03-251-12/+38
|
* proto: Add option to create RELAY_EARLY via rmsg_to_ccmsg()Gabriela Moldovan2026-03-251-36/+39
| | | | This will be needed for the relay circuit reactor tests.
* proto: Move rmsg_to_ccmsg to crate-pub test moduleGabriela Moldovan2026-03-251-10/+1
| | | | We'll soon need this for the relay reactor tests too.
* Fix grammar typosTobias Stoeckmann2026-03-151-2/+2
|
* Fix word duplicate typosTobias Stoeckmann2026-03-151-2/+2
|
* Merge branch 'circ-sync-view-streams' into 'main'gabi-2502026-02-161-3/+1
|\ | | | | | | | | | | | | proto: Replace circuit-scoped `CircSyncView` with per-hop alternative Closes #2351 See merge request tpo/core/arti!3680
| * proto: Rename CircSyncView to CircHopSyncViewGabriela Moldovan2026-02-161-1/+1
| | | | | | | | And update the docs
| * proto: Replace CircSyncView with previously client-only CircSyncViewGabriela Moldovan2026-02-161-2/+0
| | | | | | | | | | | | | | | | | | | | Note: this commit only contains the removal of the old `CircSyncView`, and it of course doens't compile. A future commit will replace the removed file with the `syncview.rs` from the client module. This change is split over two commits because it makes reviewing easier (`git mv`ing the new file over the old results in a confusing diff, because `git` refuses to show it as a move).
| * proto: Rename ClientCircSyncView to CircSyncViewGabriela Moldovan2026-02-161-1/+1
| | | | | | | | | | This will soon replace `CircSyncView` wholesale. The preliminary renaming will make the future diffs easier to review.
* | proto: Use is_multiple_of() as suggested by clippyGabriela Moldovan2026-02-161-1/+1
|/
* Revert "proto: Add a new ToRelayMsg util"Gabriela Moldovan2026-02-121-13/+0
| | | | | | | | | | This reverts commit 04ab3cd848d7977baf58dd64ebfcad6aa54ecb17. Reverted because we no longer need to "peek" into the opaque `CircChanMsg` of a circuit reactor: now the implementation-dependent part of the reactor is in charge of handling the channel messages, and extracting `Relay` objects out of RELAY/RELAY_EARLY cells, which then get processed in the base reactor.
* proto: Add a new ToRelayMsg utilGabriela Moldovan2026-01-291-0/+13
| | | | | | | | | This will be used in a future commit, inside the new generic circuit reactor. We need it because RELAY cells are handled very similarly, so we need some way of finding out if a given generic chancell is actually a RELAY cell that we can handle in an implementation-agnostic way.
* proto: Move TimeoutEstimator to utilGabriela Moldovan2026-01-291-11/+3
| | | | | This will be used in the stream reactor too (and the stream reactor will eventually replace the corresponding client impl).
* proto: Make ClientCircChanMsg pub(super)David Goulet2025-12-101-1/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Move unit tests and minor fixDavid Goulet2025-12-101-0/+20
| | | | | | Move the client specific unit tests into the client module. Signed-off-by: David Goulet <[email protected]>
* proto: Client circuit reactor now handles AnyChanMsgDavid Goulet2025-12-101-20/+11
| | | | | | | | | | | | | | | This commit removes the CircuitRx* based solely on the client circuit message and moves it into the top level of the crate so all reactors can use them. The client reactor then upon receiving the message, it converts the AnyChanMsg into a ClientCircChanMsg. On error, this leads to a shutdown of the entire reactor due to a fatal error. In order to pull this off, we added a CircuitAction::Shutdown that is handled as a priority. Signed-off-by: David Goulet <[email protected]>
* proto: Move ClientCircChanMsg into client moduleDavid Goulet2025-12-101-1/+22
| | | | | | | | Next commit will also move the Relay specific set into the relay module. These two sets are becoming specific to the reactor as the circuit reactor communication channel will use AnyChanMsg instead. Signed-off-by: David Goulet <[email protected]>
* proto: Add comment about create_firsthop_fastNick Mathewson2025-12-031-1/+2
|
* proto: Allow unstable_name_collisions in several placesGabriela Moldovan2025-12-011-0/+5
|
* tor-proto: Track information on when tunnels were last usedNick Mathewson2025-11-121-0/+17
| | | | This is part of an implementation for proposal 368.
* 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
|
* bad_extend_test_impl: Wait for message instead of a 100 ms delay.Nick Mathewson2025-11-041-8/+18
| | | | Possible fix for #2232.
* proto: use assert_matches in circuit.rs tests.Nick Mathewson2025-11-041-5/+6
| | | | | | | | | Unlike assert!(matches!(..)), assert_matches prints the value of the expression on a failure. Probably we should use this macro more widely in the future. This might help diagnose recurrences of #2232
* proto: Replace ClientCircSyncView in IncomingStreamRequestFilterGabriela Moldovan2025-10-301-2/+2
|
* proto: Move StreamMpsc{Sender,Receiver} to stream moduleGabriela Moldovan2025-10-211-5/+3
| | | | These will be shared with the relay code.
* proto: Move hop settings into a shared moduleGabriela Moldovan2025-10-211-300/+6
|
* Cleanup: Remove a variable renameNick Mathewson2025-10-201-4/+2
|
* Refactor: turn circ_extensions_from_settings into a methodNick Mathewson2025-10-201-0/+60
| | | | Closes #2067.
* proto: Move celltypes out of clientGabriela Moldovan2025-10-131-2/+1
| | | | | Some of these are relay-specific, so it makes more sense to pull this into a top-level module.
* Merge branch 'mv-flow-ctrl' into 'main'gabi-2502025-10-081-1/+1
|\ | | | | | | | | proto: Move flow_ctrl module under stream. See merge request tpo/core/arti!3335
| * proto: Move flow_ctrl module under stream (fmt).Gabriela Moldovan2025-10-071-1/+1
| |
| * proto: Move flow_ctrl module under stream.Gabriela Moldovan2025-10-071-1/+1
| | | | | | | | This will be used by exits too, so I am moving it out of `client`.
* | tor-proto: deprecate handshake-specific create/extend variantsNick Mathewson2025-10-071-0/+10
|/ | | | | | | Everybody should use create_firsthop() and extend(), and let tor-proto decide which handshake is best. Closes #1990.
* Merge branch 'expire-halfstream-cbt' into 'main'gabi-2502025-09-241-0/+96
|\ | | | | | | | | | | | | proto: Remove half-streams when they expire. Closes #264 See merge request tpo/core/arti!3267
| * proto: Add test to ensure half-streams are removed after a while.Gabriela Moldovan2025-09-191-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | This tests that the half-stream expiry works as expected. Note: it doesn't! This test currently fails, because there's a bug in the way half-streams are expired. Because we don't do it on a timer, and instead garbage-collect the half-streams on each reactor iteration, if the reactor is stuck long enough `.await`ing a message on one of its channels (for example, the `input` one), there is a chance it will accept a cell on a half-stream that should've been expired. A future commit will fix this bug.
| * proto: Use the CBT to compute half-stream timeouts.Gabriela Moldovan2025-09-161-0/+16
| |