| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As with the tor-chanmgr code, the circuit manager is now implemented
using an AbstractCircMgr type that uses traits to abstract the
particular behavior of other types that it uses. (Specifically:
circuits, building circuits, and telling whether one circuit usage
is compatible with another.) Abstracting out the dependencies in
this ways makes it possible to test the circuit manager without
having to actually build real circuits.
This commit also introduces new behavior for handling pending
circuit requests. Upon getting a new request, first we check to see
if there's an existing circuit we can use. If there isn't, we look
for pending circuits and wait for them. If there aren't any pending
circuits we can use, we launch one or more, and wait for them.
So far, that's the same as the old behavior. But here's a change:
if, while we are waiting for some pending circuits, a different
circuit is completed, and it's one we could use, then the task that
was building _that_ circuit will tell us: "please look at this
circuit". This gives us better changes of getting a usable circuit
fast.
Minor changes:
* The Error type in CircMgr no longer uses anyhow; several errors
have been simplified.
* We've gotten more formal about the relationship between circuit
usage and target usage.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This patch refactors the internal representation of the TorPath type to
use an enum for representing its state. We add explicit constructor
methods to create the different types of path's, such that client users
can write code that uses different paths based on their need.
This work was done together with Nick as part of the Arti hackathon.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Rust 1.52 just came out, and there are new clippy lints to deal
with:
* It spots more cases when we could use Option::map
* It spots more cases when we could use Iterator::flatten
* When we build a struct instance, it wants us to list the fields
in the same order that the struct declares them.
|
| |
|
|
|
|
|
|
| |
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).
|
| | |
|
| | |
|
| |
|
|
|
| |
This is a big change, but it is a step towards our goal of removing
tor_rtcompat:: calls directly.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
These necessitated a little complexity for our circuit
creation/extension API; we might want to refactor that down the
road.
|
| | |
|
| |
|
|
|
|
|
|
| |
Previously we'd just remember the port that we _wanted_ a circuit
for, and forget all the ports that it _could_ support.
This is part of a bigger circmgr revision/refactoring pass; there
should be cleanups before I merge this.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 is mainly a refactoring commit, with a little new code.
It also adds #[derive(Copy,Clone)] for a few types.
|
| |
|
|
| |
These have a FallbackDirectory as target, rather than a Relay.
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|