summaryrefslogtreecommitdiff
path: root/crates/tor-proto/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'stream-docs' into 'main'David Goulet2026-05-283-4/+4
|\ | | | | | | | | proto: Replace outdated references to RawCellStream See merge request tpo/core/arti!4036
| * proto: Replace outdated references to RawCellStreamGabriela Moldovan2026-05-283-4/+4
| | | | | | | | | | `RawCellStream` was removed long ago, in c559754116678866eabe525f5b189b50cc78b5cc.
* | tor-proto: remove `use asynchronous_codec as futures_codec` in ↵Neel Chauhan2026-05-271-13/+14
|/ | | | | | `/channel/handler.rs` Closes #1690.
* Merge branch 'relay-destroy' into 'main'gabi-2502026-05-263-31/+161
|\ | | | | | | | | proto: Add tests for DESTROY and TRUNCATE handling See merge request tpo/core/arti!4008
| * proto: Remove TODOs about flushing pending dataGabriela Moldovan2026-05-262-8/+0
| | | | | | | | | | | | We decided the reactor is the wrong place to handle this. See discussion in #2490
| * proto: Remove unused asyncGabriela Moldovan2026-05-201-3/+2
| |
| * proto: Make TRUNCATE trigger a proto violationGabriela Moldovan2026-05-202-5/+25
| |
| * proto: Add some tests for DESTROY handlingGabriela Moldovan2026-05-201-1/+60
| |
| * proto: Make do_create2_handshake() check EXTENDED2 was sentGabriela Moldovan2026-05-201-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds an extra assertion that ensures the relay reactor does in fact send an EXTENDED2 on its towards-the-client channel after receiving the CREATED2 response from the fake hop. This check is nice to have in general, but the main reason I'm doing this now is because for the DESTROY tests I'm about to add, I need the inbound MPSC queue (towards the client) drained of these handshake messages in order to check that the "next" cell we've sent is a destroy. I could've added some custom code to drain it just for the purposes of that test, but I think it's better to have `do_create2_handshake()` take care of it.
| * proto: Extend helper to check that DESTROY was sent in both directionsGabriela Moldovan2026-05-201-7/+21
| |
| * proto: Rename a test helper and adjust its docsGabriela Moldovan2026-05-201-7/+6
| | | | | | | | | | | | | | | | The new name is (hopefully) a bit more descriptive. I'm planning on extending this function soon to support checking if a DESTROY has been sent on the outbound channel too, so I'm tweaking the docs a bit in preparation for that.
| * proto: Return the CircId from test handshake helperGabriela Moldovan2026-05-201-2/+4
| | | | | | | | I'll soon need this for a DESTROY test.
| * proto: Add test helper for sending AnyChanMsgsGabriela Moldovan2026-05-201-0/+5
| |
| * proto: Add a comment clarifying why we don't need to propagate DESTROYGabriela Moldovan2026-05-201-0/+7
| |
| * proto: Adjust DESTROY-related logs in the backward reactorGabriela Moldovan2026-05-201-2/+6
| | | | | | | | | | | | | | This changes a debug log to have the same format as the corresponding DESTROY-related log from the forward reactor. Part of #2490
| * proto: Pass the cell by reference to resolve a warningGabriela Moldovan2026-05-201-3/+2
| |
| * proto: Log a message when a forward DESTROY comes alongGabriela Moldovan2026-05-201-3/+15
| | | | | | | | Part of #2490
* | Merge branch 'socket-buf-size' into 'main'opara2026-05-211-0/+1
|\ \ | | | | | | | | | | | | | | | | | | Set socket buffer sizes (`SO_SNDBUF` and `SO_RCVBUF`) for proxy sockets Closes #2500 See merge request tpo/core/arti!3957
| * | tor-proto: add note about proxy socket buf sizesSteven Engler2026-05-071-0/+1
| | |
* | | tor-proto: destructure the `ReactorStreamComponents`Steven Engler2026-05-211-5/+12
| | |
* | | tor-proto: have `StreamReqInfo` store a `ReactorStreamComponents`Steven Engler2026-05-216-49/+41
| | |
* | | tor-proto: add a TODO item for XON/XOFF flow controlSteven Engler2026-05-211-0/+3
| | |
* | | tor-proto: move memquota stream account arg to last positionSteven Engler2026-05-215-11/+11
| | | | | | | | | | | | This better matches nearby code.
* | | tor-proto: clean up `CIRCUIT_BUFFER_SIZE`Steven Engler2026-05-213-12/+1
| | |
* | | tor-proto: move more stream queue init to reactorSteven Engler2026-05-217-149/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | tor-proto: add `ReactorStreamComponents` to bundle return valsSteven Engler2026-05-207-29/+54
| | |
* | | tor-proto: small comment improvementsSteven Engler2026-05-202-1/+3
| | |
* | | tor-proto: remove unneeded type aliasSteven Engler2026-05-201-5/+2
| | |
* | | tor-proto: always use a bounded mpsc queue for streamsSteven Engler2026-05-203-39/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whether a stream queue should be bounded or unbounded is a decision that needs to be made at runtime depending on the type of flow control used, not at build-time. Window-based flow control should be bounded and XON/XOFF flow control should be unbounded. If we wanted to support both bounded and unbounded queues, it would take a bunch of boilerplate code to wrap the senders and receivers in enums. Instead we make the queue always bounded, but use a large bound for XON/XOFF flow control.
* | | tor-proto: add `FlowCtrlHooks::inbound_queue_max_len()`Steven Engler2026-05-203-1/+35
| | |
* | | tor-proto: move stream incoming queue init to reactorSteven Engler2026-05-207-69/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: small cleanup of `CircHopOutbound::build_flow_ctrl()`Steven Engler2026-05-201-11/+4
| | |
* | | tor-proto: rename `{,Half}StreamFlowCtrlInner` variantsSteven Engler2026-05-201-10/+10
| | | | | | | | | | | | The common suffix isn't needed.
* | | Merge branch 'vegas-stall' into 'main'David Goulet2026-05-204-14/+36
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | tor-proto: Don't run vegas algorithm when a clock stall/jump was detected Closes #2504 See merge request tpo/core/arti!3967
| * | tor-proto: vegas: return early if clock stall was detectedSteven Engler2026-05-073-10/+23
| | |
| * | tor-proto: rtt: return clock stall/jump status from `update()`Steven Engler2026-05-071-4/+13
| | |
* | | Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-1214-38/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the circ-padding feature is enabled, we use maybenot, which does not yet support rand 0.10. In the meantime, enabling this feature pulls in rand 0.9. This is not ideal, but should be okay as a temporary situation. This also replaces the use of ReseedingRng (which was removed in 0.10) with the reseeding_rng crate. This is somewhat less performant, but it should be okay.
* | | tor-proto: clean up return type of `Circuit::begin_stream()`Steven Engler2026-05-112-13/+8
| | |
* | | tor-proto: indentation cleanupSteven Engler2026-05-111-20/+15
| | |
* | | tor-proto: reorg error handling for BeginStream reactor cmdSteven Engler2026-05-112-10/+26
| | |
* | | proto: Derive PartialEq for MetaCellDispositionGabriela Moldovan2026-05-071-1/+1
|/ /
* | tor-proto: rename `*FlowCtrl::e` to `inner`Steven Engler2026-05-071-15/+15
| |
* | tor-proto: rename `*FlowCtrlEnum` to `*FlowCtrlInner`Steven Engler2026-05-071-14/+14
| |
* | tor-proto: fix flow control for half-streamsSteven Engler2026-05-075-79/+98
| | | | | | | | | | | | | | | | | | | | This moves the window-based flow control for half-streams out of the `HalfStream` and into the `HalfStreamWindowFlowCtrl` object. Now that it's applied only in `HalfStreamWindowFlowCtrl` and not generally for all half-streams, we no longer apply window-based flow control to half-streams when they're really using xon/xoff-based flow control.
* | tor-proto: add prototype for `HalfStreamFlowCtrl`Steven Engler2026-05-073-4/+124
| | | | | | | | | | This adds the general structure, and we'll fill it in and use it in a following commit.
* | tor-proto: comment change on `StreamFlowCtrl`Steven Engler2026-05-071-1/+6
|/
* proto: Remove an allow for a now-pedantic warning.Nick Mathewson2026-05-071-6/+0
|
* proto rpc: Turn tunnel paths into a dictNick Mathewson2026-04-283-9/+40
| | | | | | | | | 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.
* proto rpc: Change PathEntry to an enum.Nick Mathewson2026-04-281-28/+30
|
* proto: Add an RPC function to access tunnel and inspect its path.Nick Mathewson2026-04-282-0/+225
| | | | Additionally, allow inspecting tunnel paths directly from streams.