summaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'versions' into 'main'Ian Jackson2025-02-061-18/+18
|\ | | | | | | | | Version bumps for 1.4.0 See merge request tpo/core/arti!2773
| * Version bumps to 0.27.0Ian Jackson2025-02-061-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See Release.md. maint/list_crates | grep -P '^tor-|^arti-' | xargs -n1 nailing-cargo -Eu set-version --bump minor -p This completes the version bumps. The report of changed crates, before I started the release work, is: $ maint/changed_crates -v "arti-v$LAST_VERSION" oneshot-fused-workaround: No change. slotmap-careful: No change. test-temp-dir: No change. fslock-guard: No change. hashx: No change. equix: No change. tor-basic-utils: No change. caret: No change. fs-mistrust safelog: No change. retry-error: No change. tor-error tor-general-addr: No change. tor-geoip: No change. tor-rtcompat tor-rtmock tor-async-utils tor-config tor-config-path tor-rpc-connect tor-log-ratelim: No change. tor-rpcbase tor-memquota: No change. tor-units tor-llcrypto: No change. tor-protover: No change. tor-bytes tor-checkable: No change. tor-cert tor-key-forge tor-hscrypto: No change. tor-socksproto: No change. tor-linkspec: No change. tor-cell: No change. tor-proto tor-netdoc: No change. tor-consdiff: No change. tor-netdir tor-relay-selection: No change. tor-persist tor-chanmgr tor-ptmgr: No change. tor-guardmgr: No change. tor-circmgr tor-dirclient: No change. tor-dirmgr: No change. tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy: No change. tor-relay-crypto arti-client arti-relay arti-rpcserver arti arti-rpc-client-core $
* | Fix Cargo.toml features formattingIan Jackson2025-02-061-1/+3
| | | | | | | | Manual line breaks which fixup-features doesn't know how to add.
* | Add some missing "full" featuresIan Jackson2025-02-061-1/+1
|/ | | | | | | Precisely the results of maint/fixup-features. Some crates end up with slightly odd formatting, which I will fix in a moment.
* tor-proto: remove `use asynchronous_codec as futures_codec`Neel Chauhan2025-02-063-18/+18
| | | | Closes #1690.
* tor-proto: Make ControlHandler::handler return non-optional result.Gabriela Moldovan2025-02-062-14/+14
| | | | | | The commands for which the function returned `Ok(None)` have been refactored into `CtrlCmd`, so we no longer need `handle()` to return an `Option`.
* tor-proto: Turn some CtrlMsgs into CtrlCmds.Gabriela Moldovan2025-02-063-147/+166
| | | | | | | All `CtrlMsg`s to which the reactor did not respond by sending a cell down the channel are now `CtrlCmd`s. Most of this is code motion, best reviewed with `--color-moved`.
* tor-proto: Make shutdown a CtrlCmd.Gabriela Moldovan2025-02-063-26/+58
|
* proto: Fix feature gated importDavid Goulet2025-02-041-2/+5
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Move the begin cell handling into CircHopDavid Goulet2025-02-042-47/+38
| | | | | | | Move the BEGIN cell handling into CircHop following the previous commit that move more code into CircHop. Signed-off-by: David Goulet <[email protected]>
* proto: Move the close stream action into CircHopDavid Goulet2025-02-041-51/+55
| | | | | | | | | | | | | | | | | This is the first commit of a series to make CircHop own the code of its related actions. This commit moves the "close stream" code into CircHop now owning the action and offloading the Reactor code. In order to do this, and future changes like for example handling BEGIN, the CircHop needs to be aware of its hop number. This change also allows us to add the hop number to logging. It also copies the reactor unique ID to each hop for logging purposes. Future commit will continue to move more code into CircHop. Signed-off-by: David Goulet <[email protected]>
* proto: Remove ConversationInHandlerDavid Goulet2025-02-045-114/+6
| | | | | | | | | | | | | | | | | | | It is unused but most importantly it allows any RELAY cell to be sent from anywhere in the code which is really not desirable because it is skipping congestion control. It also allows us to remove the `control_tx` from the reactor which is one less channel to track/understand/think about. This opens up the door to all sorts of problems especially side channel that can be exploited if we are not careful. We can always bring this back if we need it but for now, it is unused and allows us to remove the `CtrlMsg::SendRelayCell` control message. No code behavior change. Signed-off-by: David Goulet <[email protected]>
* proto: Introduce a reactor ControlHandlerDavid Goulet2025-02-042-223/+248
| | | | | | | | | | | | | This object only mission is to handle a control message (CtrlMsg). It encapsulates a reference to the reactor and its lifetime is only the time it takes to handle the message. Main goal of this is to try to reduce reactor.rs size into logical containers. No code behavior change. Signed-off-by: David Goulet <[email protected]>
* tor-proto: Ensure rx end of chan reactor output sink is not dropped in test.Gabriela Moldovan2025-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This hopefully fixes #1832. I haven't been able to repro the failure from #1832 locally, but judging from the logs, I suspect it's triggered by interleavings like: - `extend_fut` executes up until `circ.extend_ntor(..).await`, where it's blocked `await`ing a completion notification from the circuit reactor - `reply_fut` starts running: * `CircuitExtender` installs a meta-handler in the circuit reactor, and waits for an `EXTENDED2` cell * `test_extend()` reads a cell from the receiving end of the fake channel's output sink (`rx`) * `test_extend()` sends the `EXTENDED2` cell to the circuit reactor over `CircuitRxSender` * `rx` is dropped - `reply_fut` completes - in the channel reactor's `run_once()`, `select_biased!` resolves to an error, because the receiving end of the `output` sink (`rx`) was dropped. The reactor logs `got sink error: SendError { kind: Disconnected }` (see [`SendError`]), and exits - the circuit reactor exits too, because the receiving end of its `chan_sender` (which was in the channel reactor) was dropped Returning the `rx` of the fake channel's output sink from `reply_fut` *should* stop it from being dropped, and fix #1832. [`SendError`]: https://docs.rs/futures/latest/futures/channel/mpsc/struct.SendError.html#method.is_disconnected
* Merge branch 'proto-datactl-api-fixes2' into 'main'Nick Mathewson2025-01-303-29/+28
|\ | | | | | | | | tor-proto: Tweak StreamCtrl APIs for RPC. See merge request tpo/core/arti!2755
| * proto: deprecate DataStream::circuitNick Mathewson2025-01-301-0/+4
| | | | | | | | | | | | | | | | This method is experimental, so no semver note is needed. It is redundant with `client_stream_ctrl()?.circuit()?`. (The name and the unconditional return type of this method are probably an error.)
| * proto: Rename (experimental) DataStream functions for ctrl accessNick Mathewson2025-01-301-6/+6
| | | | | | | | | | Since these return a client-specific type, they need a client-specific name before we can stabilize them for RPC.
| * proto: Rename ClientDataStreamCtrl::{is_open=>is_connected}Nick Mathewson2025-01-301-5/+2
| | | | | | | | | | | | | | Semantically, the new name matches the behavior much better. (A stream could well count as open if we had sent a RESOLVE but not received a RESOLVED, so we might someday want to have an `is_open` defined for _all_ streams, not just data streams.)
| * proto: Rename DataStreamCtrl to ClientDataStreamCtrlNick Mathewson2025-01-302-17/+17
| | | | | | | | | | | | The API for this type, and the fact that it implements ClientStreamCtrl unconditionally, means that it is only for client DataStreams.
| * proto: Clarify applicability of ClientStreamCtrl.Nick Mathewson2025-01-301-4/+2
| |
* | Merge branch 'reactor-stuff' into 'main'David Goulet2025-01-308-757/+1184
|\ \ | |/ |/| | | | | tor-proto: Rewrite circuit reactor run_once() loop to use select!. See merge request tpo/core/arti!2747
| * tor-proto: Remove outdated docs about AsyncMutex use.Gabriela Moldovan2025-01-301-7/+0
| |
| * tor-proto: Remove unnecessary time_prov argument.David Goulet2025-01-301-28/+17
| |
| * tor-proto: Remove unnecessary Mutex around chan_sender.David Goulet2025-01-301-44/+20
| |
| * tor-proto: Resolve clippy warning about mut refs in debug_assert.Gabriela Moldovan2025-01-291-6/+7
| | | | | | | | | | | | It's unclear to me why this warning didn't fire before! The the circuit reactor had this exact same `debug_assert` prior to the refactoring, taking a mutable reference to the `StreamMap`.
| * tor-proto: Add a clippy allow and corresponding TODO.Gabriela Moldovan2025-01-291-0/+1
| |
| * tor-proto: Remove now-unused Reactor::send_outbound().Gabriela Moldovan2025-01-291-74/+0
| | | | | | | | This is now handled in `Reactor::ready_streams_iterator()`.
| * tor-proto: Remove old Reactor::run_once().Gabriela Moldovan2025-01-291-66/+0
| | | | | | | | | | | | | | | | | | This is replaced by the new `Reactor::run_once()` impl. Note: this removal is in a separate commit to make the diff of the refactoring commits easier to review (the diff between the old and the new impl is not meaningful because the new impl is practically a rewrite).
| * tor-proto: Remove now-unused CellStatus enum.Gabriela Moldovan2025-01-291-9/+0
| | | | | | | | This is replaced by `Option<RunOnceCmdInner>`.
| * tor-proto: Rewrite circuit reactor run_once() loop to use select! (fmt).Gabriela Moldovan2025-01-292-27/+29
| |
| * tor-proto: Rewrite circuit reactor run_once() loop to use select!.Gabriela Moldovan2025-01-297-207/+650
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This rewrites the circuit reactor main loop to use `select_biased!` to poll multiple futures simultaneously. The new `run_once()`, like the old, first waits for an initial `CtrlMsg::Create`. Then, it uses a `select_biased!` to poll the `chan_sender` sink and shutdown channel for readiness. When the channel sink is ready, we poll the `control` and `input` channels like before, as well as the new `ready_streams` `Stream` (`ready_streams` is a `futures::Stream` that replaces the previous `send_outbound()` function). Most of the implementation remains unchanged, except the `handle_input`, `handle_cell` and `handle_control` functions no longer send anything on the `chan_sender` channel. Instead, they may do some (synchronous) processing, and send instructions for the remaining work that needs to be done (for example, for writing the cell to the `chan_sender` channel). These instructions are handled at the end of `run_once()`, and are encoded in the `RunOnceCmdInner` enum. What this change does **not** do: * the control channel *still* bypasses congestion control. We could fix this by making the various reactor functions send the `RunOnceCmdInner` commands to `run_once()` via a channel (instead of returning them). This would enable the reactor to stop reading the commands (except for handle `Sendme`, which would be handled separately) if it's blocked on congestion control.
| * tor-proto: Use SendRelayCell within CtrlMsg::SendRelayCell.Gabriela Moldovan2025-01-293-8/+8
| |
| * tor-proto: Add enums for representing run_once() commands.Gabriela Moldovan2025-01-291-0/+104
| |
| * tor-proto: Move SendMsgAndInstallHandler handling to a separate function.Gabriela Moldovan2025-01-291-13/+24
| |
| * tor-proto: Move the CircuitExtender to a separate module.Gabriela Moldovan2025-01-292-266/+295
| |
| * tor-proto: Move CtrlMsg to its own module.Gabriela Moldovan2025-01-292-181/+209
| | | | | | | | No functional changes, just code motion.
| * tor-async-utils: Make SometimesUnboundedSink::send_unbounded() pub(crate).Gabriela Moldovan2025-01-291-2/+1
| | | | | | | | | | We are about to use this in the circuit reactor (instead of `pollish_send_unbounded`).
* | fix: fix typosDimitris Apostolou2025-01-304-8/+8
|/
* tor-proto: Use SENDME_TAG_LEN constant instead of magic value.Gabriela Moldovan2025-01-282-7/+8
|
* tor-proto: Use CircTag::try_from for clarity.Gabriela Moldovan2025-01-282-7/+12
|
* tor-proto: Use CircTag instead of raw byte slice.Gabriela Moldovan2025-01-282-7/+6
|
* tor-proto: Move stream msg delivery to a separate function (fmt).Gabriela Moldovan2025-01-281-33/+32
|
* tor-proto: Move stream msg delivery to a separate function.Gabriela Moldovan2025-01-281-33/+47
| | | | | | | This is mostly code motion (I recommend reviewing with `--color-moved`). The code is intentionally misindented to make diffing easier. A future commit will fix the indentation.
* tor-proto: Move stream ID extraction out of handle_relay_msg().Gabriela Moldovan2025-01-281-9/+18
|
* tor-proto: Wrap an extra long lone.Gabriela Moldovan2025-01-281-1/+5
|
* tor-proto: Use continue instead of () for clarity.Gabriela Moldovan2025-01-281-1/+1
|
* tor-proto: Adjust handle_cell() docs.Gabriela Moldovan2025-01-281-1/+1
|
* tor-proto: Split handle_relay_cell().Gabriela Moldovan2025-01-281-4/+15
|
* tor-proto: Split out send_relay_cell().Gabriela Moldovan2025-01-282-13/+28
|
* tor-proto: Group imports.Gabriela Moldovan2025-01-281-2/+1
|