| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | | |
rpclib: Improve error outputs.
Closes #1650 and #1826
See merge request tpo/core/arti!2766
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
We want to explain better what has happened, not only with the final
fatal error, but with any nonfatal errors that occurred in the middle.
Closes #1826.
|
| | | |
| | |
| | |
| | | |
Closes #1650.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
In general, we try to obey the convention that an error's Display
method does not display that error's sources.
Part of #1650.
|
| | | |
| | |
| | |
| | | |
This is needed to Report on the output of `StdError::source`.
|
| | |/ |
|
| |\ \
| |/
|/|
| |
| |
| |
| | |
Rewrite download manager example
Closes #1471 and #1386
See merge request tpo/core/arti!2725
|
| |/ |
|
| |\
| |
| |
| |
| |
| |
| | |
rpclib: In tests, use an ersatz socketpair on windows.
Closes #1831
See merge request tpo/core/arti!2761
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes #1831.
I'm doing this because switching from the socketpair crate to an
ersatz connect-to-localhost socketpair made the test pass.
My windows skills are weak, but it appears possible that you aren't
supposed to simultaneously have a blocking ReadFile and a blocking
WriteFile to a named pipe from separate threads? At least, that's
consistent with our findings in !2758.
I first saw this hack in perl, when I needed it in 2003.
I am displeased that it is still apparently needed in 2025.
|
| | |
| |
| |
| | |
This was the slowest test in our suite.
|
| |\ \
| |/
|/|
| |
| | |
maint: use `Crate.subdir` in matrix-check
See merge request tpo/core/arti!2762
|
| | | |
|
| |/ |
|
| |\
| |
| |
| |
| |
| |
| | |
tor-proto: Ensure rx end of chan reactor output sink is not dropped in test.
Closes #1832
See merge request tpo/core/arti!2760
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |\ \
| | |
| | |
| | |
| | | |
rpc: Fix test builds on Windows.
See merge request tpo/core/arti!2756
|
| | | | |
|
| |\ \ \
| | | |
| | | |
| | | |
| | | | |
fix RUSTSEC-2025-0004
See merge request tpo/core/arti!2759
|
| |/ / / |
|
| |\ \ \
| |_|/
|/| |
| | |
| | | |
docs: Fix the logo path.
See merge request tpo/core/arti!2757
|
| | | | |
|
| |\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
rpc: Document what is actually going on with stream optimism.
Closes #1583
See merge request tpo/core/arti!2753
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Our documentation had dated to an older version of our RPC stream
code, where all streams were automatically optimistic.
But as explained, our use of "optimistic"ness in RPC stream code is
now purely internal, to make it possible to get an DataStreamCtrl.
This isn't user-visible in our rpc_conn_open_stream code.
Closes #1583
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In brief: we _do_ correct implement correct optimistic vs
nonoptimistic behavior for RPC streams. Only our documentation was
wrong. Subsequent commits will fix our documentation more.
See #1583.
|
| |\ \ \ \
| |_|/ /
|/| | |
| | | |
| | | | |
tor-proto: Tweak StreamCtrl APIs for RPC.
See merge request tpo/core/arti!2755
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.)
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
Since these return a client-specific type,
they need a client-specific name before we can stabilize them for RPC.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.)
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The API for this type, and the fact that it implements
ClientStreamCtrl unconditionally, means that it is only for client
DataStreams.
|
| | | | | |
|
| |\ \ \ \
| |_|_|/
|/| | |
| | | |
| | | | |
tor-proto: Rewrite circuit reactor run_once() loop to use select!.
See merge request tpo/core/arti!2747
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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`.
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | | |
This is now handled in `Reactor::ready_streams_iterator()`.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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).
|
| | | | |
| | | |
| | | |
| | | | |
This is replaced by `Option<RunOnceCmdInner>`.
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | | | |
|
| | | | | |
|
| | | | | |
|