| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
This fixes an `unfulfilled_lint_expectations` warning.
tor-proto conditionally sets a global `allow(unused)`, and if you have
an `expect(unused)` field within an `allow(unused)` struct, rust seems
to warn with 'unfulfilled_lint_expectations'.
https://github.com/rust-lang/rust/issues/160942
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
We have decided that instead of "uniq_id" in logging, we'll use the
"<domaine>-[<type>]-id" syntax to indicate who is that unique ID.
This commit only renames circuit's unique ID to "circ_uniq_id".
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
This commit only affects logging. Whenever possible, log both the UniqId
and CircId.
This also changes the log lines which is now "uniq_id=" and "circ_id="
as the UniqId is internal and circ_id (CircId) is protocol level.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
```text
$ cargo test -p tor-proto --features relay
[...]
error[E0405]: cannot find trait `IncomingStreamRequestFilter` in this scope
--> crates/tor-proto/src/circuit/reactor.rs:631:10
|
631 | impl IncomingStreamRequestFilter for AllowAllStreamsFilter {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
```
|
| |
|
|
|
|
|
|
|
|
|
| |
Now that relays no longer use `CtrlCmd::AwaitStreamRequests`, some of
these fields are unused. I'm leaving them in for now, but we should
remove them if they're still unused after we finish the circ reactor
impl.
I'm not removing `AwaitStreamRequests`, because it will be needed by
onion services, when we replace the old client circuit reactor with the
new one.
|
| |
|
|
| |
The tests don't compile otherwise.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This commit executes maint/add_warning with the just added change to
deny string slices except in tests.
I recommend auditing this by checking out the previous commit followed
by running the script yourself and then verifying that the diff is
identical to this commit.
This commit makes cargo clippy fail. We will add exceptions in the next
commit.
|
| | |
|
| | |
|
| |
|
|
| |
This will soon be used by the relay tests too.
|
| | |
|
| |
|
|
| |
This will be needed for the relay circuit reactor tests.
|
| |
|
|
| |
We'll soon need this for the relay reactor tests too.
|
| | |
|
| |
|
|
|
| |
This will enable us to obtain implementation-dependent asynchronous
events (such as the outcome of an extend handshake).
|
| |
|
|
|
|
| |
The channel provider is relay-specific, so I am moving it to the relay
`ForwardHandler` implementation. This enables us to get rid of some of
the feature gating from the generic reactor.
|
| |
|
|
|
|
|
| |
In the backward reactor, we call this the `forward_reactor_rx` (because
it receives commands from the foward reactor), and in the forward
reactor we call it `backward_reactor_tx` (because it sends commands to
the backward reactor).
|
| |
|
|
|
|
|
|
|
|
| |
We settled on
* `inbound_chan{tx, rx}`, for the inbound channel (the channel towards
the guard, if we are a client, or towards the client if we are a
relay)
* `outbound_chan{tx, rx}`, for the outbound channel (the channel
towards the exit, if we are a middle relay)
|
| | |
|
| |
|
|
| |
This is not just for clients!
|
| |
|
|
| |
Currently empty, will be fleshed out in a future commit.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
| |
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`).
|
| |
|
|
|
|
| |
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`.
|
| | |
|
| |
|
|
|
|
|
| |
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]>
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
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.
|
| | |
|
| | |
|