aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | tor-proto: bring back comparison chain w/ allowhashcatHitman2025-10-081-9/+14
| | | | | | | | | | | | | | | | It was decided that the comparison chain was actually preferrable for readability. So instead, we're just `allow`ing it until it stops being a problem. Signed-off-by: hashcatHitman <[email protected]>
* | tor-proto: replace comparison chain with matchhashcatHitman2025-10-081-8/+9
|/ | | | | | | | | | | | | | | | | | | | | | | | | There was a comparison chain in `tor_proto::util::poll_all::test::ResolveAfter::poll` which was causing a clippy warning. The lint in question, `clippy::comparison_chain`, was a `clippy::style` lint in 1.85.1 and got moved to `clippy::pedantic` in 1.87.0 (see [rust-clippy!14219]). Since some of us (like me) develop on MSRV, I'm fixing this lint now. Gabi didn't have any strong opinions on whether I did it like this or with an `allow` attribute, so I decided this was better since it means we don't have to come back later just to remove the `allow`. It should be noted that using a match like this can sometimes be a performance regression (see [rust-clippy#5354] and [rust-clippy!6390]). I would expect in this case the effect will be very little, if any, but if tests in `tor_proto::util::poll_all::test` start taking much longer and having an impact on CI or something, this could be why. [rust-clippy!14219]: https://github.com/rust-lang/rust-clippy/pull/14219 [rust-clippy#5354]: https://github.com/rust-lang/rust-clippy/issues/5354 [rust-clippy!6390]: https://github.com/rust-lang/rust-clippy/pull/6390 Signed-off-by: hashcatHitman <[email protected]>
* Merge branch 'mv-flow-ctrl' into 'main'gabi-2502025-10-0820-30/+32
|\ | | | | | | | | proto: Move flow_ctrl module under stream. See merge request tpo/core/arti!3335
| * proto: Fix flow control docs post-move.Gabriela Moldovan2025-10-071-2/+2
| | | | | | | | | | | | | | | | | | | | `StreamFlowCtrl` is no longer accessible via `tor_proto::client`, so I had to update one of the (doc) imports with its new path Also, I had to change a couple of imports to use `DataWriter` and `DataStream` from `crate::client::stream` instead of `crate::client::stream::data`, because the latter is not visible from `flow_ctrl` anymore.
| * proto: Move flow_ctrl module under stream (fmt).Gabriela Moldovan2025-10-0711-22/+18
| |
| * proto: Move flow_ctrl module under stream.Gabriela Moldovan2025-10-0720-24/+25
| | | | | | | | This will be used by exits too, so I am moving it out of `client`.
| * proto: Add a top-level stream module.Gabriela Moldovan2025-10-072-0/+5
| | | | | | | | | | This will house the implementation-agnostic stream types and functionality.
* | 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-068-52/+346
|\ | | | | | | | | 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: experimental API to install a per-channel padder.Nick Mathewson2025-10-022-0/+44
| |
| * proto: Implement channel padding with maybenot padders.Nick Mathewson2025-10-023-14/+95
| | | | | | | | With this commit we now actually generate padding when we're told to.
| * proto: start implementing logic for padding actions.Nick Mathewson2025-10-024-3/+48
| |
| * Add a blocker to channel outbound sink.Nick Mathewson2025-10-023-1/+20
| |
| * proto: Make DynTimeProvider explicit in channel padder types.Nick Mathewson2025-10-021-2/+6
| |
| * proto: Trigger maybenot events for channel-level padding.Nick Mathewson2025-10-023-7/+44
| |
| * proto: Generate per-sender NormalSent events from circuits.Nick Mathewson2025-10-012-4/+14
| |
| * proto: Propagate PaddingCtrl into ChannelSender.Nick Mathewson2025-10-011-43/+68
| | | | | | | | We'll need it to tell the channel padder when padding is queued.
| * proto: Add maybenot padding objects to the channel reactorNick Mathewson2025-10-012-1/+26
| |
* | 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.
* Merge branch 'ticket_2190' into 'main'Nick Mathewson2025-09-303-40/+34
|\ | | | | | | | | | | | | padding: Remove post-queue blocker. Closes #2190 See merge request tpo/core/arti!3293
| * padding: Remove post-queue blocker.Nick Mathewson2025-09-303-37/+31
| | | | | | | | | | | | | | 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
| |
* | Merge branch 'doc_features_no_longer_there' into 'main'Nick Mathewson2025-09-301-1/+1
|\ \ | |/ |/| | | | | | | | | Remove check_doc_features and doc_auto_cfg. Closes #1514 See merge request tpo/core/arti!3294
| * Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | | | | | This feature has been removed from nightly, in favor of doc_cfg.
* | Merge branch 'sort_circ_actions' into 'main'Nick Mathewson2025-09-291-1/+48
|\ \ | |/ |/| | | | | Sort output events for next_circ_action. See merge request tpo/core/arti!3292
| * 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
* | Merge branch 'opentelemetry' into 'main'wesleyac2025-09-291-1/+4
|\ \ | |/ |/| | | | | Add experimental OpenTelemetry support See merge request tpo/core/arti!3239
| * opentelemetry: Add some instrument macros.Wesley Aptekar-Cassels2025-09-241-1/+4
| | | | | | | | | | I've added these in places that are useful for the debugging that I've been doing.
* | 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: Document exactly how PollAll polls its futures.Gabriela Moldovan2025-09-251-1/+11
| |
* | proto: Resolve a couple of clippy warnings in the tests.Gabriela Moldovan2025-09-251-2/+2
| |
* | 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: Add PollAll helper for driving futures in lockstep.Gabriela Moldovan2025-09-252-0/+196
| |
* | 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-254-10/+16
|/ | | | | | 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-2412-35/+282
|\ | | | | | | | | | | | | 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
| |