| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Improve testing for cases where change_state() is given a bad
function.
|
| |
|
|
|
|
|
| |
To make this work we have to wrap std::io::Error in an Arc. The
benefit of having these errors implement Clone is that we can
provide the same Error in response to multiple requests when they
are all waiting on the same operation.
|
| | |
|
| |
|
|
|
|
| |
This would have saved ahf and me a lot of confusion in debugging a
situation where we were cloning a reference of a type that didn't
implement Clone.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
This is a somewhat obnoxious change in its scope and requirements,
but it makes it easier to understand what the real public and
private parts of our APIs are.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Since these parts are testing-only, let's take steps to make sure we
don't ship them in production by accident.
|
| |
|
|
|
|
| |
Now that we have MockNetRuntime and MockSleepRuntime, we can use
them to test a channel-builder by replaying the contents of a TLS
stream that it will accept.
|
| | |
|
| |
|
|
|
|
|
|
| |
These lints force us to declare our exported enums and
exhaustive-looking structs as non-exhaustive (so that we can add to
them in the future without breaking our API) or to explicitly
disable the warning for a given enum/struct (to say that we _intend_
for additions to be a breaking change).
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Additionally:
Use futures::future::Shared instead of event_listener.
|
| |
|
|
|
| |
It seemed like a good idea at first, but we need to be able to
tell the difference between these error types more easily.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This is a big change, but it is a step towards our goal of removing
tor_rtcompat:: calls directly.
|
| |
|
|
|
| |
Now there is nothing in principle that you couldn't access from a
Runtime implementation.
|
| | |
|
| |
|
|
| |
Now we don't need runtime-specific stuff in tor-chanmgr.
|
| |
|
|
|
|
|
|
|
|
|
| |
Now other crates don't need any 'ifdef tokio' code, since there
are wrappers that implement 'futures' right.
Technically, the 'futures' traits are in some ways less good than
the tokio ones, but we need a consistent API if we want to support
WASM someday and keep support for async_std. I'd rather hold out
hope for a future version of futures::io working like tokio than to
fix ourselves into the tokioverse forever.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
For these, we need to call tor_rtcompat::task::block_on() directly,
since they would crash with tokio enabled. Perhaps down the line we
should look for a better fix here.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is fairly ugly and I think I'll need to mess around with the
feature configuration a while until we get something that's pleasant
to develop with. This still seems like a good idea, though, since
we _will_ need to be executor-agnostic in the end, or we'll have no
way to handle wasm or embedded environments.
Later down the road, we'll probably want to use futures::Executor or
futures::Spawn more than having global entry points in
tor_rtcompat. That would probably make our feature story simpler.
Tokio is the default now, since tokio seems to be more heavily used
for performance-critical stuff.
This patch breaks tests; the next one will fix them, albeit
questionably.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes a whole lot of our code simpler, and makes it so that
CircMgr and DirMgr no longer need to have anything parameterized
over transports, either.
Instead of boxing Transport inside of ChanMgr, I've made a new
Connection trait that goes from a ChanTarget* straight to a Channel.
This lets us avoid having to box the intermediate TLS object.
[*] Actually, a copy of the information from a ChanTarget. Ick, but
I had to make a copy to avoid parameterizing
Connecter::build_channel.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
This lets us have the notion of "get the first hop of a path as some
kind of a chantarget", which will make it easier to write other path
types.
|
| |
|
|
| |
This lets us make the test for closed channels non-async.
|
| |
|
|
|
| |
Since these don't change while the channel is alive, we don't need
the lock to protect them.
|
| |
|
|
|
|
| |
Previously every channel was a secret Arc<>, which I think is bad
style, and which stopped us from using weak references in other
places.
|
| | |
|
| |
|
|
|
| |
Like tor_llcrypto, this crate is meant to expose only the part of
other crates (in this case, a async runtime crate) that we use.
|