| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
| |
These were supposed to fail loudly in debug builds by panicking, but
panics are mostly useless for debugging in async applications that use a
runtime which catches panics. So we'll just log the error instead.
|
| |
|
|
| |
`upgrade_pending_channel_to_open`
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
An attempt to make sure that there are no code paths which forget to
remove a pending channel from the channel map.
This also adds error-level log messages and panics during debug builds
if a `PendingChannelHandle` is dropped without properly passing it to
`MgrState::remove_pending_channel` or
`MgrState::replace_pending_channel`.
|
| |
|
|
|
|
|
|
| |
This reverts commit f85bc3cf849109aaa2c4da9fc8c06e7173a0543f.
There were some small conflcits in
`AbstractChanMgr::get_or_launch_internal`, so this wasn't a clean
revert.
|
| |\
| |
| |
| |
| | |
tor-chanmgr: update comments about selecting pending channels
See merge request tpo/core/arti!2544
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
This handle contains all of the details required to remove or replace a
pending channel entry from the channel map.
|
| | |
| |
| |
| |
| |
| | |
These methods on `MgrState` acquire a lock, and it's easy for calling
code to also try to acquire the same lock within the closure, causing a
deadlock. It's better to not expose these methods.
|
| | | |
|
| | |
| |
| |
| | |
Best reviewed with the '-w' flag to hide whitespace changes.
|
| |/
|
|
|
|
|
|
| |
This moves most of the channel map logic from
`AbstractChanMgr::choose_action` to `MgrState::request_channel`.
This is working towards being able to remove
`MgrState::with_channels{,_and_params}`.
|
| |
|
|
| |
Fixes a TODO.
|
| | |
|
| |
|
|
|
| |
This delivers a fresh account per channel to the places where channels
are actually made, but doesn't pass them to tor-proto yet.
|
| |
|
|
|
|
|
|
|
| |
Plumb through a top-level account. This doesn't have any
channel-specific, circuit-specific or stream-specific accounts yet.
tor-circmgr's and tor-hsclient's *tests* need fake account.
In arti-relay, use a dummy account for now.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
The channel manager in the future will need to be able to receive
incoming streams. The type of the stream depends on an associated type
within `ChannelFactory`, so this commit exposes this associated type
through several other types, eventually to the `ChanMgr`.
The new methods are behind the experimental "relay" feature flag.
|
| |
|
|
|
| |
This allows us to set SRVs for example (needed because by default, the
test `NetDir` is built from a consensus that doesn't contain any SRVs).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, Channel was a type that you could Clone that implicitly
its state. Now, Channel always appears as an Arc<Channel>.
This change has several benefits:
* It makes the relationship between Channel struct and the
underlying channel more clear.
* It enables Channel to participate in the RPC system,
where everything has to be an Arc<.>
* It enables us to have a Weak<Channel>, if we ever want to.
* It will let us move various members out of ChannelDetails.
We did this change a while ago with ClientCirc.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
This fixes a race condition that would normally be fairly benign -
it would result in scheduling to check for expired channels again
immediately, and assuming non-zero time passes would then remove the
channel.
In Shadow's default time model though, zero time passes in this case,
so we just keep scheduling to check again immediately forever; i.e.
deadlock.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
See here for documentation on the lint:
https://rust-lang.github.io/rust-clippy/master/index.html#/diverging_sub_expression
The issue here, from what I can tell, is that the lint triggers
whenever you use a diverging expression as a function body within an
|
| |
|
|
|
|
| |
I could also have stopped using `::default()` to construct this
(testing-only) object, but I think it makes more sense to turn it
into a non-unit object.
|
| |
|
|
| |
This fixes a warning from nightly clippy.
|
| |
|
|
|
|
| |
lifetime configurable.
Signed-off-by: Gabriela Moldovan <[email protected]>
|
| |
|
|
|
| |
We want to call ErrorReport::report() on Errors, but this isn't an
Error but only a string.
|
| |
|
|
|
| |
This panics on error, and we're fine with a panic on misbehavior in
tests.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit makes the `ChanBuilder` type in `tor-chanmgr` usable by
consumers outside of that crate, like the doc comment for
`ChannelFactory` says you need to be able to do in order to turn your
`TransportHelper` into something useful.
As part of doing this, the `event_sender` its constructor takes needed
to be dealt with, since it was a crate-internal type that came from
inside the `ChanMgr`.
Enter `BootstrapReporter`: an opaque wrapper around that sender, now
provided as an additional argument to
`ChannelFactory::connect_via_transport`. You can now construct a
`ChanBuilder` outside this crate, and it'll still be able to report its
bootstrap status by unwrapping this new type that's threaded through
from the `ChanMgr`. (This was a fair deal of manually threading the type
through all the layers in this crate!)
Note that you cannot implement bootstrap updating using something that
isn't `ChanBuilder` yet due to the type being entirely opaque (but, of
course, we can figure out exactly what API the reporter should have
later, and add that capability in).
|
| | |
|
| |
|
|
|
|
|
| |
This commit makes it possible to replace the default channel factory
(used when there is no PtMgr), and to replace the PtMgr.
This is part of #659.
|
| |
|
|
|
|
| |
We will want the freedom to replace this, so it needs to go behind a
lock. We need to be able to Clone it cheaply now, so we're using an
Arc instead of a Box.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This is another pure renaming.
|
| |
|
|
|
|
|
|
|
| |
We're doing this because the type now holds "all the mutable state
in a ChanMgr", not just the map.
This is a pure renaming; no documentation has been updated.
Part of #606.
|
| | |
|
| |
|
|
|
|
|
| |
Now, instead of duplicate checks in various cases, we simply go
through the loop one last time.
This allows us to simplify some of our other logic around here.
|
| | |
|