aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/client/reactor.rs
Commit message (Collapse)AuthorAgeFilesLines
* proto: Rename CircId and UniqId variable nameDavid Goulet2026-08-031-2/+2
| | | | | | | | | | | | | | | 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]>
* tor-cell: rename `XonKbpsEwma` to `XonKBpsEwma`Steven Engler2026-07-301-2/+2
|
* tor-proto: add `ReactorStreamComponents` to bundle return valsSteven Engler2026-05-201-7/+11
|
* tor-proto: move stream incoming queue init to reactorSteven Engler2026-05-201-2/+10
| | | | | | | | | | | The stream queue length (for messages incoming from the Tor network) depends on the type of flow control we're using for the hop. Currently we construct the stream queue outside of the circuit reactor, but we don't have the flow control information here. Instead of constructing the stream queue outside of the reactor and passing the sender into the reactor, we construct the stream queue inside of the reactor and pass the receiver out of the reactor.
* tor-proto: indentation cleanupSteven Engler2026-05-111-20/+15
|
* tor-proto: reorg error handling for BeginStream reactor cmdSteven Engler2026-05-111-8/+7
|
* proto: Derive PartialEq for MetaCellDispositionGabriela Moldovan2026-05-071-1/+1
|
* tor-proto: lower log level of "removing circuit leg"Steven Engler2026-04-061-1/+1
| | | | This appears often in the arti logs, but is a normal thing to happen.
* Fix word duplicate typosTobias Stoeckmann2026-03-151-1/+1
|
* proto: Replace CircSyncView with previously client-only CircSyncViewGabriela Moldovan2026-02-161-1/+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: Factor ReactorResultChannel into the shared reactor moduleGabriela Moldovan2026-01-291-3/+1
| | | | This is not just for clients!
* proto: Move TimeoutEstimator to utilGabriela Moldovan2026-01-291-1/+2
| | | | | This will be used in the stream reactor too (and the stream reactor will eventually replace the corresponding client impl).
* proto: Dedupe IncomingStreamRequestHandlerGabriela Moldovan2026-01-121-24/+1
|
* proto: Add an immediate order for client CircuitEvent orderingDavid Goulet2025-12-101-4/+7
| | | | | | | With a protocol violation, we have to immediately deal with such event before emitting anything on the wire. Signed-off-by: David Goulet <[email protected]>
* proto: Rename CircuitAction and cie to CircuitEventDavid Goulet2025-12-101-45/+37
| | | | | | | | | | This mirrors also the relay reactor. We've introduced the ProtoViolation into a previous commit which is not an action but rather an "event" that happened on a circuit. And so, better semantic. No behavior change. Signed-off-by: David Goulet <[email protected]>
* proto: Rename Circuit{Action/Event}::Shutdown to ProtoViolationDavid Goulet2025-12-101-5/+6
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Client circuit reactor now handles AnyChanMsgDavid Goulet2025-12-101-2/+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-2/+1
| | | | | | | | 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]>
* Merge branch 'relay-streams2' into 'main'David Goulet2025-12-021-55/+6
|\ | | | | | | | | proto: Start handling incoming streams in the relay reactor See merge request tpo/core/arti!3487
| * proto: Remove crate-level STREAM_READER_BUFFER reexportGabriela Moldovan2025-11-241-2/+0
| | | | | | | | All this indirection is making me dizzy.
| * proto: Move a couple of stream-related constants to stream modGabriela Moldovan2025-11-241-1/+1
| |
| * proto: Move StreamReqInfo to stream moduleGabriela Moldovan2025-11-241-50/+6
| |
| * proto: Make the hop in StreamReqInfo optionalGabriela Moldovan2025-11-241-4/+1
| | | | | | | | We are about to use `StreamReqInfo` for exit streams too.
* | opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-241-1/+10
|/ | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* proto: Make the hop in SendRelayCell optional (fmt)Gabriela Moldovan2025-11-171-1/+5
|
* proto: Make the hop in SendRelayCell optionalGabriela Moldovan2025-11-171-4/+4
|
* proto: Move SendRelayCell to circhop (fmt)Gabriela Moldovan2025-11-171-1/+1
|
* proto: Move SendRelayCell to circhopGabriela Moldovan2025-11-171-14/+1
| | | | | This will be used by relays too, once we modify it to make the `HopNum` optional.
* proto: Move CloseStreamBehavior to top-level stream moduleGabriela Moldovan2025-11-141-23/+2
|
* proto: Remove extraneous backtick in CloseStreamBehavior docsGabriela Moldovan2025-11-141-1/+1
|
* Drop two use's that seem no longer to be necessaryIan Jackson2025-11-061-1/+1
|
* proto: Move StreamMpsc{Sender,Receiver} to stream module (fmt)Gabriela Moldovan2025-10-211-1/+1
|
* proto: Move StreamMpsc{Sender,Receiver} to stream moduleGabriela Moldovan2025-10-211-1/+1
| | | | These will be shared with the relay code.
* proto: Move streammap out of the client moduleGabriela Moldovan2025-10-211-2/+3
|
* proto: Move dumb pipes to top-lvl stream module (fmt)Gabriela Moldovan2025-10-211-1/+1
|
* proto: Move dumb pipes to top-lvl stream moduleGabriela Moldovan2025-10-211-1/+1
|
* proto: Fix docs to refer to the right stream:: paths.Gabriela Moldovan2025-10-161-1/+1
|
* proto: Reformat imports post-move.Gabriela Moldovan2025-10-161-1/+1
|
* proto: Avoid crate-pub reexports of shared types from the client module.Gabriela Moldovan2025-10-161-1/+1
| | | | | This makes it easier to see which parts are implementation-agnostic (i.e. do not import from crate::client).
* Merge branch 'celltypes' into 'main'gabi-2502025-10-141-1/+1
|\ | | | | | | | | proto: Move celltypes out of client See merge request tpo/core/arti!3355
| * proto: Move celltypes out of clientGabriela Moldovan2025-10-131-1/+1
| | | | | | | | | | Some of these are relay-specific, so it makes more sense to pull this into a top-level module.
* | proto: Stop using tunnel IDs in relay reactor.Gabriela Moldovan2025-10-131-6/+0
|/ | | | | | | | | | | | Using a tunnel ID here doesn't make much sense right now, because we don't yet support exit-side conflux (and when we will, it's unclear whether the concept of "tunnel" will be applicable, especially if we refactor things such that multi-path circuits are handled without a ConfluxSet-like type like we have for clients). This change forces us to stop using the client-specific `unwrap_or_shutdown` (because this macro expects `self` to have a tunnel ID), but IMO that is okay.
* proto: Move flow_ctrl module under stream (fmt).Gabriela Moldovan2025-10-071-2/+2
|
* proto: Move flow_ctrl module under stream.Gabriela Moldovan2025-10-071-2/+2
| | | | This will be used by exits too, so I am moving it out of `client`.
* tor-proto: fix comment related to validating stream messagesSteven Engler2025-09-301-3/+4
| | | | | | | | | | I don't think the previous comment is correct. The main flow control checks are about receiving SENDME/XON/XOFFs, and ensuring that we don't receive too many of them. This all happens in the reactor. In theory the stream should be checking that we don't receive too many DATA messages for how many stream SENDMEs we've sent. But this is broken due to arti#2100. We do check this in the halfstream code though.
* Sort output events for next_circ_action.Nick Mathewson2025-09-291-1/+48
| | | | | | | | This sort makes it so that that blocking and unblocking are always ordered in a sensible way with respect to sending data. This might help simplify padding machines a bit. Prerequisite for #2190
* proto: Rewrite ConfluxSet::next_circ_action() using PollAll.Gabriela Moldovan2025-09-251-1/+1
| | | | | | | | | | | | | | | | | This removes our usage of `FuturesUnordered` in `ConfluxSet::next_circ_action()` to address two issues: * a fairness issue, where the futures driven by `FuturesUnordered` could be starved under some circumstances (#2180) * a logic error, where we'd explicitly avoid reading from the input channel if the outgoing `chan_sender` channel was blocked (#2179) Note that the fixing the latter will cause the reactor to buffer more into the unbounded `chan_sender` sink, but that *should* be okay, because no input message should be able cause us to queue cells excessively. Closes #2179, #2180
* proto: Return multiple actions from next_circ_action (fmt).Gabriela Moldovan2025-09-251-47/+47
|
* proto: Return multiple actions from next_circ_action.Gabriela Moldovan2025-09-251-2/+5
| | | | | | | Part of #2180 Note: the code is intentionaly left misindented to make reviewing a bit easier. A future commit will fix the indentation.
* Merge branch 'expire-halfstream-cbt' into 'main'gabi-2502025-09-241-11/+41
|\ | | | | | | | | | | | | proto: Remove half-streams when they expire. Closes #264 See merge request tpo/core/arti!3267