aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/client
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge branch 'celltypes' into 'main'gabi-2502025-10-146-187/+5
|\ | | | | | | | | proto: Move celltypes out of client See merge request tpo/core/arti!3355
| * proto: Move celltypes out of clientGabriela Moldovan2025-10-136-187/+5
| | | | | | | | | | Some of these are relay-specific, so it makes more sense to pull this into a top-level module.
* | Merge branch 'unique-id' into 'main'David Goulet2025-10-141-6/+0
|\ \ | | | | | | | | | | | | proto: Stop using tunnel IDs in relay reactor. See merge request tpo/core/arti!3353
| * | 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: Use a small vec for the hop list.Gabriela Moldovan2025-10-131-1/+7
|/ | | | | We can optimize for the general (N <= 3) case, and avoid a heap allocation.
* Merge branch 'mv-flow-ctrl' into 'main'gabi-2502025-10-0817-1083/+14
|\ | | | | | | | | 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-078-18/+14
| |
| * proto: Move flow_ctrl module under stream.Gabriela Moldovan2025-10-0717-1079/+14
| | | | | | | | 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 'chan_padder' into 'main'Nick Mathewson2025-10-064-4/+20
|\ | | | | | | | | Apply maybenot padding to channels See merge request tpo/core/arti!3314
| * proto: Add a comment to note a naming issue.Nick Mathewson2025-10-021-0/+4
| |
| * proto: Implement channel padding with maybenot padders.Nick Mathewson2025-10-021-1/+0
| | | | | | | | With this commit we now actually generate padding when we're told to.
| * proto: Trigger maybenot events for channel-level padding.Nick Mathewson2025-10-022-0/+9
| |
| * proto: Generate per-sender NormalSent events from circuits.Nick Mathewson2025-10-011-3/+7
| |
* | 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.
* padding: Remove post-queue blocker.Nick Mathewson2025-09-302-36/+26
| | | | | | | We no longer want to _ever_ block non-DATA cells, per discussion in circuit-padding.md. Closes #2190.
* padding: be less dogmatic in a TODO about where a buffer would go.Nick Mathewson2025-09-301-4/+4
|
* 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: Replace magic value with constant (fmt).Gabriela Moldovan2025-09-251-1/+2
|
* proto: Replace magic value with constant.Gabriela Moldovan2025-09-251-4/+9
| | | | | Also derives `CIRC_ACTION_COUNT` from the two other constants instead of hard-coding the value.
* proto: Use MAX_CONFLUX_LEGS instead of magic number.Gabriela Moldovan2025-09-251-1/+2
| | | | | Besides, it's better if we use the same number for the expected number of legs as we do in the conflux set impl.
* proto: Make padding and timeout actions take priority.Gabriela Moldovan2025-09-251-34/+69
| | | | | | | | | | This rewrites `next_circ_action()` yet again, using two layers of `PollAll`: * the inner layer drives an individual circuit leg. Each circuit has a `PollAll` that drives its futures * the outer layer drives the inner `PollAll`s belonging to the circuits that form the tunnel
* proto: Add comment emphasizing that the PollAll ordering matters.Gabriela Moldovan2025-09-251-0/+7
|
* proto: Add comment explaining why we need the chan_sender readiness check.Gabriela Moldovan2025-09-251-0/+3
|
* proto: Rewrite should_skip_join_point to return bool.Gabriela Moldovan2025-09-251-11/+10
| | | | | We don't really need to return a `HopNum` anymore (because we work out the join point `HopNum` unconditionally in `next_circ_action`).
* proto: Avoid polling join point streams more than once.Gabriela Moldovan2025-09-251-6/+11
| | | | | | If we poll the ready streams on the join point more than once per reactor loop, we risk sending more than one DATA cell (which is not good, because cc might block after the first cell is sent).
* proto: Remove now-unused function.Gabriela Moldovan2025-09-251-21/+2
|
* proto: Rewrite ConfluxSet::next_circ_action() using PollAll.Gabriela Moldovan2025-09-254-132/+109
| | | | | | | | | | | | | | | | | 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: Expose CircHopList in ConfluxSet.Gabriela Moldovan2025-09-251-1/+1
| | | | | We will soon need to access this directly (rather than via a method on `Circuit`) to work around borrow checker limitations.
* 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-252-4/+17
| | | | | | | Part of #2180 Note: the code is intentionaly left misindented to make reviewing a bit easier. A future commit will fix the indentation.
* proto: Push conflux state checks inside handshake_timeout() (fmt).Gabriela Moldovan2025-09-251-6/+6
|
* proto: Push conflux state checks inside handshake_timeout().Gabriela Moldovan2025-09-253-9/+13
| | | | | | This simplifies the calling code, which will, in turn, make it easier for us to simplify the logic in ConfluxSet::next_circ_action() and abolish the questionable use of FuturesUnordered.
* Merge branch 'expire-halfstream-cbt' into 'main'gabi-2502025-09-246-28/+233
|\ | | | | | | | | | | | | proto: Remove half-streams when they expire. Closes #264 See merge request tpo/core/arti!3267
| * proto: Temporarily ignore large_enum_variant clippy warning.Gabriela Moldovan2025-09-231-0/+1
| | | | | | | | I want to tackle this separately, as part of #2003
| * proto: Apply deferred rustfmt.Gabriela Moldovan2025-09-221-3/+1
| |
| * proto: Remove duplicate word in comment.Gabriela Moldovan2025-09-221-1/+1
| |
| * proto: Add new error type for cells received on non-existent streams.Gabriela Moldovan2025-09-223-11/+24
| | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3267#note_3261239
| * proto: Log circuit reactor errors at debug level.Gabriela Moldovan2025-09-221-2/+2
| |
| * proto: Reject any messages arriving on expired half-streams.Gabriela Moldovan2025-09-193-3/+11
| | | | | | | | | | | | Half-streams are periodically removed from each hop's stream map by the reactor main loop, but we still need to ensure we reject any messages arriving on expired half-streams in between these cleanup cycles.
| * 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: Calculate CBT more accurately.Gabriela Moldovan2025-09-192-4/+9
| | | | | | | | | | | | This should look at length of the circuit up until the hop where the half-stream is (because the half-stream might be on an intermediate hop, and not necessarily on the final one).
| * proto: Remove half-streams when they expire.Gabriela Moldovan2025-09-164-1/+33
| | | | | | | | Closes #264
| * proto: Use the CBT to compute half-stream timeouts.Gabriela Moldovan2025-09-163-9/+37
| |
| * proto: Give Each EndSentStreamEnt an expiry (fmt).Gabriela Moldovan2025-09-162-2/+8
| |
| * proto: Give Each EndSentStreamEnt an expiry.Gabriela Moldovan2025-09-164-8/+44
| |
| * proto: Remove unnecessary IEFE.Gabriela Moldovan2025-09-161-6/+4
| | | | | | | | | | The move of `self` into the closure was getting in the way, as I will need to reference `self` again below.
* | tor-proto: add some trace logs to XON/XOFF codeSteven Engler2025-09-221-0/+9
| |
* | Merge branch 'xon-xoff-checker' into 'main'David Goulet2025-09-187-42/+62
|\ \ | | | | | | | | | | | | tor-proto: Small improvements to XON/XOFF code See merge request tpo/core/arti!3273
| * | tor-proto: fix a hard-coded `cc_xoff_client`Steven Engler2025-09-182-4/+15
| | | | | | | | | | | | This should be `cc_xoff_exit` if we're an exit.