| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A CircId is now a circ_id and a UniqId is a unique_id so we stop
confusing them in the code.
Furthermore, channel_id that are CircId are now circ_id. Channel IDs are
different and encoded internally into a UniqId.
This is the first step to clarify semantic before we change the logging
to log both unique ID and circ ID.
No behavior change.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
| |
We decided the reactor is the wrong place to handle this.
See discussion in #2490
|
| | |
|
| |
|
|
|
|
|
| |
This changes a debug log to have the same format as the corresponding
DESTROY-related log from the forward reactor.
Part of #2490
|
| |
|
|
| |
Closes #2345
|
| |
|
|
| |
This will tell the base `BackwardReactor` how to handle the cell.
|
| | |
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
| |
This currently duplicates the client `IncomingStreamRequestHandler`.
To deduplicate it, we need the `hop_num` to be optional (it will be
`None` for relays, and `Some(hopnum)` in the client reactor).
The next commit will fix the code duplication.
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
| |
Same as the client reactor, a message outside of our restricted set
leads to a reactor shutdown.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit removes the CircuitRx* based solely on the client circuit
message and moves it into the top level of the crate so all reactors can
use them.
The client reactor then upon receiving the message, it converts the
AnyChanMsg into a ClientCircChanMsg. On error, this leads to a shutdown
of the entire reactor due to a fatal error.
In order to pull this off, we added a CircuitAction::Shutdown that is
handled as a priority.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
| |
This follows the move of the client specific object.
Signed-off-by: David Goulet <[email protected]>
|
| | |
|
| | |
|
| |
|
|
|
|
| |
This TODO was copied over from the client reactor, but it doesn't make
any sense here (we don't yet handle control messages in the backward
reactor).
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The relay reactor is now able to handle incoming stream requests (i.e.
cells that open streams). It currently only supports DATA stream
requests (BEGIN); support for other stream types (BEGIN_DIR, RESOLVE)
will be added later.
`Reactor::new()` now returns the futures::Stream of Tor streams, alongside
the `Reactor` and `RelayCirc` handle. Whoever calls `Reactor::new()` is
responsible for passing the stream of streams over to the task that is
meant to handle it ("handle" in this case means either rejecting the
stream with a given `END` cell, or accepting it and forwarding the
connection between it and the corresponding application stream).
IMPORTANT: the above is a bit half-baked! Next on my TODO list is is to
iron out the details of how/where this will actually be handled.
I am also a bit unsure about the API here: I think it might've been
nicer to give the user the ability to obtain this `futures::Stream` from
`RelayCirc`, which is, after all, a handle to the reactor?
Also on my short-term TODO list is to figure out how conflux will affect
this API and usage.
And there is another wrinkle here: for incoming DATA stream requests,
the handler will need to produce a resulting `DataStream`, which is not
yet fully implementation-agnostic (it wraps a `ClientDataStreamCtrl`).
This too will be handled in a separate MR.
|
| |
|
|
| |
These will need to be handled soon
|
| |
|
|
|
| |
This is needed because we will soon have another callsite for it, which
will need to pass `AnyRelayMsgOuter`.
|
| |
|
|
|
| |
This is already namespaced under the `relay` module so the `Relay`
prefix is redundant.
|
| |
|
|
|
|
|
| |
This MPSC channel now has zero buffering, because if the backward
reactor can't send the cell, the forward reactor must immediately stop
reading from its inputs (note that the backward reactor's Tor channel
towards the client *does* have a buffering layer).
|
| |
|
|
|
| |
There are other types of messages (like circuit-level SENDMEs) that need
to be handled in the backward reactor too.
|
| |
|
|
|
| |
We will soon need a handle to the runtime in BackwardReactor (we need a
time provider to call `note_sendme_received()`).
|
| |
|
|
|
| |
We need to avoid reading from all of these if the chan_sender isn't
ready, because otherwise we can't provide backpressure.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The backward reactor needs this for handling padding (because it may
need to e.g. put the chan sender in a blocked state).
Note that `CircuitCellSender` has an underlying
`SometimesUnboundedSink`, so from now on we must be very careful and
avoid writing to the `chan_sender` if it's not ready (because otherwise
we can end up buffering unboundedly). The next commit will add some
extra checks against reading from futures::Streams that might cause us
to write to the `chan_sender` sink (futures::Sink).
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Control messages are handled in RelayReactor instead of BackwardReactor.
|
| |
|
|
|
| |
This only moves the control/command fields to RelayReactor. The next
step is to actually implement the control message handling and dispatch.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
The `RelayReactor` now holds the sending end of the shutdown broadcast
channel, so if `RelayReactor` exits, both the forward and the backward
relay reactor will notice and shut down too.
Similarly, if the forward or backward reactor exits, the `RelayReactor`
will notice (because it select!s between the two), and will shut down
|
| | |
|
| |
|
|
|
|
|
|
| |
The channel provider is used to request outgoing channels from the
`ChanMgr` in response to `EXTEND`/`EXTEND2` cells, so it belongs in the
`ForwardReactor`.
(This was leftover from the old circ reactor architecture)
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This is the first step towards parallelizing stream reads and
writes.
|
| |
|
|
|
| |
This makes it a bit clearer that `cell_rx` is for moving stream data
between `ForwardReactor` and `BackwardReactor`.
|
| |
|
|
| |
The forward/backward terminology is clearer.
|
| |
|
|
|
| |
BackwardReactor is not meant to be used directly (the channel reactor is
supposed to use the `RelayReactor` wrapper instead).
|
|
|
`BackwardReactor` now exists alongside `ForwardReactor`,
to make it clearer that they are siblings.
|