| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
| |
And update the docs
|
| |
|
|
|
| |
Now that CircSyncView no longer needs to know the total number of
streams, we can use it in the new per-hop stream reactor design.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`IncomingStreamRequestFilter`s, and `CircSyncView`s, by extension, are used
both by old relay implementation and the new one for implementing an
out-of-reactor way of deciding how to handle an incoming stream.
In the new circuit reactor design, we have a separate stream reactor for
each hop. Upon receiving an incoming stream, the stream reactor will
need to build one of these `CircSyncView` objects, and then pass it to
an externally-provided `IncomingStreamRequestFilter`. Before this
change, `CircSyncView::n_open_streams()` returned the total number of
open streams, which wouldn't have worked with the new reactor design,
because the per-hop stream reactor doesn't have a global view of all the
hops, so its `CircSyncView` can't return the total number of streams (at
least not without message passing, or sharing state with the other
stream reactors).
|
| |
|
|
|
|
|
|
|
|
| |
Note: this commit only contains the removal of the old `CircSyncView`,
and it of course doens't compile. A future commit will replace the
removed file with the `syncview.rs` from the client module.
This change is split over two commits because it makes reviewing easier
(`git mv`ing the new file over the old results in a confusing diff,
because `git` refuses to show it as a move).
|
| |
|
|
|
| |
This will soon replace `CircSyncView` wholesale. The preliminary
renaming will make the future diffs easier to review.
|
| |
|
|
|
|
|
|
|
|
| |
This reverts commit 04ab3cd848d7977baf58dd64ebfcad6aa54ecb17.
Reverted because we no longer need to "peek" into the opaque
`CircChanMsg` of a circuit reactor: now the implementation-dependent
part of the reactor is in charge of handling the channel messages,
and extracting `Relay` objects out of RELAY/RELAY_EARLY cells,
which then get processed in the base reactor.
|
| |
|
|
|
|
|
|
| |
This doesn't need to be part of the `ForwardHandler` trait anymore,
because the base reactor no longer calls it directly (instead
implementations are supposed to handle it internally).
No functional changes here, just code motion.
|
| |
|
|
| |
Closes #2339
|
| | |
|
| |
|
|
|
| |
Needed because some messages are handled differently depending on the
cell type they originated from (RELAY vs RELAY_EARLY).
|
| |
|
|
|
|
|
|
|
|
|
| |
This pushes the RELAY/REALY_EARLY handling inside
`handle_forward_cell()`, which now decodes the relay cells and
* handles them internally, if they are unrecognized
(`handle_unrecognized_cell()`), or
* returns them back to the base reactor if they are recognized
(RELAY and RELAY_EARLY cells are handled the same way by the
base reactor)
|
| |
|
|
|
| |
Soon this function will be in charge of decoding the cell too, so it
will need a handle to the `HopMgr` (see `decode_relay_cell()`)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the implementation-dependent `handle_forward_cell()` handled
all forward cells *except* for RELAY cells, which were handled in the
generic base reactor.
This changes the implementation to pass *all* cells, including RELAY
cells, to `handle_forward_cell()` too. This is needed because both
RELAY and RELAY_EARLY cells need to be handled very similarly: both
can be either recognized or unrecognized, with unrecognized cells
being handled by the implementation-dependent code, and the recognized
ones being sent to the base reactor for handling.
A future commit will update `handle_forward_cell()` to extract `Relay`
object out of RELAY/RELAY_EARLY cells, and return it back to the base
reactor for handling.
|
| | |
|
| | |
|
| |
|
|
| |
This will tell the base `BackwardReactor` how to handle the cell.
|
| |
|
|
|
|
|
|
|
|
| |
Implements this part of the spec:
```
To tear down a circuit completely, a relay or client sends a DESTROY
cell to the adjacent nodes on that circuit, using the appropriate
direction’s circID.
```
|
| |
|
|
|
|
|
|
| |
To handle EXTEND2, the relay `ForwardHandler` impl spawns a background
task, which reports back the result via the `CircEvent` MPSC stream.
This stream is polled from the `ForwardReactor` main loop, and each
`CircEvent` is passed back to `ForwardHandler::handle_event()` for
handling.
|
| |
|
|
| |
These will be used by the relay code too (for circuit extension).
|
| | |
|
| | |
|
| |
|
|
|
| |
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.
|
| |
|
|
| |
This was leftover from back when this command was only for Sendmes.
|
| |
|
|
| |
This was leftover from back when the BWD was a relay-specific type.
|
| | |
|
| |
|
|
|
| |
This will soon be used for instructing the BWD to send other types of
messages too.
|
| |
|
|
|
|
|
| |
The backward reactor will soon need the ability to send other types of
relay messages too: it will soon need the ability to respond to EXTEND2
by sending back an EXTENDED2, so I am preemptively making this function
more general so we can reuse it.
|
| |
|
|
| |
This will need to become async soon.
|
| | |
|
| |
|
|
|
|
|
| |
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 will change significantly in the near future, or disappear
entirely.
|
| | |
|
| |
|
|
|
|
|
|
| |
This is just because the generic reactor will soon need a clone of the
CC object, so I am preemptively making this function return a ref to the
underlying `Arc` instead. Technically, it would've been fine to just
kept this method and add a separate one returning `&Arc<Mutex<..>>`,
but I'd prefer keeping the API small.
|
| |
|
|
|
|
| |
Soon it won't need be needed here any more. I'm removing it, because
having redundant handles to the CC state makes it difficult to see
exactly where it's being used from.
|
| |
|
|
| |
This is not just for clients!
|
| |
|
|
| |
Currently empty, will be fleshed out in a future commit.
|
| | |
|
| |
|
|
| |
Relays will need to use it too.
|
| | |
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
| |
Move the client specific unit tests into the client module.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
| |
This follows the move of the client specific object.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
| |
Next commit will also move the Relay specific set into the relay module.
These two sets are becoming specific to the reactor as the circuit
reactor communication channel will use AnyChanMsg instead.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
| |
Without this, `tor-proto` doesn't compile if you enable the `relay`
feature but not `hs-service`.
|
| |\
| |
| |
| |
| | |
proto: Start handling incoming streams in the relay reactor
See merge request tpo/core/arti!3487
|
| | | |
|