| Commit message (Collapse) | Author | Age | Files | Lines |
| |\
| |
| |
| |
| | |
tor-proto: Small comment and variable name changes
See merge request tpo/core/arti!3865
|
| | |
| |
| |
| | |
I think this makes the code a little easier to follow.
|
| |\ \
| |/
|/|
| |
| | |
Add support for handling CREATE_FAST cells and launching a circuit reactor
See merge request tpo/core/arti!3846
|
| | |
| |
| |
| | |
This reverts commit 9c38daf2d3548feca2ff555f5bd52165add0d20c.
|
| | |
| |
| |
| | |
This is needed for the revert in the following commit.
|
| | | |
|
| | |
| |
| |
| |
| | |
This better fits with existing code that uses `restricted_msg!` and is a
bit more flexible.
|
| |/
|
|
|
| |
Previously we would close the circuit, which isn't great because there
can be other streams in use on the circuit.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
The `ForwardHandler` trait is meant for implementation-dependent
functions that are called from the implementation-agnostic
`ForwardReactor`. Previously `handle_unrecognized_cell()` was called
directly by the generic `ForwardReactor`, but that's no longer the case,
so it doesn't belong in the trait anymore.
This commit is just code motion. Best reviewed with `--color-moved`
|
| |
|
|
| |
Closes #2417
|
| | |
|
| |
|
|
| |
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.
|
| |
|
|
| |
Typos found with codespell
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This replaces the client-specific half-stream expiry calculation from
the stream reactor (which is meant to be implementation agnostic) with a
call to the new `StreamHandler::halfstream_expiry()`, which abstracts
away the implementation-specific half-stream expiry calculation (for
example, on the client-side, the calculation takes into account the CBT,
which we don't have on the relay side).
Note that there is currently no `StreamHandler` implementation on the
client-side (because we haven't ported the client circuit reactor to the
new reactor yet).
Closes #2410
|
| |
|
|
|
| |
This will enable us to handle half-stream expiry differently on the
client side vs the exit side.
|
| |\
| |
| |
| |
| | |
proto: Add more logging to the new circuit reactors
See merge request tpo/core/arti!3776
|
| | | |
|
| |/ |
|
| | |
|
| |
|
|
| |
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.
|
| | |
|