| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
This is an intermediate step in rewriting the reactor to manage a
"conflux set" (a set of linked circuits) rather than a single circuit.
This commit contains no functional changes.
|
| | |
| |
| |
| |
| | |
These will soon be functions on `Circuit`, so it's a good time to pull
them out of the reactor impl.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
This reorders the functions from the `Reactor` implementation in
preparation for moving some of them to `Circuit`. This commit contains
no functional changes and should be reviewed with `git diff
--color-moved`.
A future commit will move part of the `Reactor` impl block to `Circuit`.
|
| | | |
|
| | |
| |
| |
| |
| | |
I am moving these handlers into a separate type because they'll need to
be shared with the active `Circuit`, for handling incoming cells.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
This represents a circuit "leg", in the conflux sense. The `Circuit`
type will be a helper for implementing tunnel reactors that contain
multiple `Circuit`s forming a conflux set.
The fields from `Circuit` were extracted from the `Reactor` struct. A
future commit will part of the `Reactor` implementation to `Circuit`.
|
| | |
| |
| |
| | |
For readability
|
| |/
|
|
|
|
|
|
|
|
| |
We will soon have a `ConfluxSet` type. Some of its operations will
return `Bug` (for example, the method for getting the *only* leg of the
conflux set will return a `Bug` if the set has no legs, or more than 1
leg).
This conversion function will make it easier these errors to
`ReactorError`.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Move StreamTarget to the tunnel module and the circuit module.
From now on streams will be implemented on tunnels, not circuits.
This moves `StreamTarget` to the tunnel module. A future change will
replace `ClientCirc` with `ClientTunnel` inside `StreamTarget`.
This is mostly code motion, best reviewed with `--color-moved`.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
| |
We're about to need this in `tor_proto::tunnel` which is from the
Conflux work.
In the spirit of upstreaming as much as possible, it is done now.
|
| |
|
|
|
| |
We will eventually need to expose this in `tor-proto`'s public API, so
it'll need to be an opaque type.
|
| |
|
|
|
| |
This will soon be used by the reactor-internal `ConfluxSet` as a unique
identifier for the circuit legs stored in its `SlotMap`.
|
| | |
|
| |
|
|
|
| |
This moves the `CreateHandshakeWrap` and its implementors to
`reactor::create` (none of these are used outside of the reactor).
|
| |
|
|
|
| |
Reducing `ClientCirc` proliferation will make our lives easier when
implementing !2790.
|
| |
|
|
|
|
|
|
| |
This gets rid of a bit of a duplicated code.
It also moves `CtrlCmd` closer to `CtrlMsg`.
Offshoot from my WIP conflux branch for #1838
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
The `Reactor` argument is never used, so we can just remove it from the
trait.
Removing this arg also simplifies #1838 for me (I am moving some code
around, and the calls to `handle_sever_aux_data` no longer have access
to the `Reactor`).
|
| |
|
|
| |
Closes #1690.
|
| |
|
|
|
|
| |
The commands for which the function returned `Ok(None)` have been
refactored into `CtrlCmd`, so we no longer need `handle()` to return an
`Option`.
|
| |
|
|
|
|
|
| |
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`.
|
| | |
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
| |
Move the BEGIN cell handling into CircHop following the previous commit
that move more code into CircHop.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |\
| |
| |
| |
| | |
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>`.
|
| | | |
|