summaryrefslogtreecommitdiff
path: root/tor-circmgr/src/path.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused import.Nick Mathewson2021-06-211-1/+0
|
* More tests and a little code-golf for coverage on tor-circmgrNick Mathewson2021-06-201-10/+9
|
* Fix some warnings about needless & from nightly clippyNick Mathewson2021-06-181-2/+2
|
* Suppress a clippy warning.Nick Mathewson2021-06-171-0/+1
|
* more improvements to circmgr tests.Nick Mathewson2021-06-161-1/+1
|
* More tests on circmgr::path.Nick Mathewson2021-06-161-0/+26
|
* Tests for circmgr::usageNick Mathewson2021-06-161-0/+10
|
* Enormous tor-circmgr rewrite.Nick Mathewson2021-06-141-25/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add an XXXX to path.rsNick Mathewson2021-06-041-0/+1
|
* cirmgr: Move usage-related code into a submodule, and refactor.Nick Mathewson2021-06-021-5/+3
|
* Refactor TorPath code to have explicit constructors.Alexander Færøy2021-05-201-8/+38
| | | | | | | | | 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.
* Prefer "relay" over "node" in most circumstances.Nick Mathewson2021-05-181-1/+1
|
* Resolve clippy warnings from Rust 1.52.Nick Mathewson2021-05-071-8/+4
| | | | | | | | | | 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.
* Enforce (and obey) clippy lints about exhaustive enums, structs.Nick Mathewson2021-04-271-0/+1
| | | | | | | | 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).
* Move around the public modules in tor_rtcompat.Nick Mathewson2021-04-171-1/+1
|
* Remove all non-runtime methods in tor_rtcompat.Nick Mathewson2021-04-161-2/+4
|
* Add a "Runtime" parameter to all the manager types.Nick Mathewson2021-04-161-5/+7
| | | | | This is a big change, but it is a step towards our goal of removing tor_rtcompat:: calls directly.
* Use Arc::clone() explicitly with port policiesNick Mathewson2021-03-291-2/+2
|
* Don't copy exit policies around; instead use Arc.George Kadianakis2021-03-291-3/+0
|
* Implement the "circwindow" and "ExtendByEd25519ID" parametersNick Mathewson2020-12-221-5/+10
| | | | | | These necessitated a little complexity for our circuit creation/extension API; we might want to refactor that down the road.
* tor-circmgr: update documentationNick Mathewson2020-12-141-1/+5
|
* Remember the actual usable ports for an exit after we've built a circuitNick Mathewson2020-12-141-0/+21
| | | | | | | | 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.
* De-parameterize ChanMgr and everything that wraps it.Nick Mathewson2020-12-081-10/+2
| | | | | | | | | | | | | | 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.
* Add support for using fallback directories in path constructionNick Mathewson2020-11-191-10/+1
| | | | | | This is mainly a refactoring commit, with a little new code. It also adds #[derive(Copy,Clone)] for a few types.
* Add a notion of a one-hop fallback path.Nick Mathewson2020-11-171-7/+11
| | | | These have a FallbackDirectory as target, rather than a Relay.
* Refactor first-hop handling types a bitNick Mathewson2020-11-171-7/+13
| | | | | | 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.
* Make Arc<>-ness of ClientCirc explicit.Nick Mathewson2020-11-121-2/+2
|
* Make the Arc-ness of channels more explicit.Nick Mathewson2020-11-121-1/+2
| | | | | | Previously every channel was a secret Arc<>, which I think is bad style, and which stopped us from using weak references in other places.
* Isolate async_std usage in a new tor_rtcompat crate.Nick Mathewson2020-11-111-6/+3
| | | | | 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.
* Use anyhow in tor-circmgr and tor-chanmgrNick Mathewson2020-11-111-1/+1
|
* Document tor-circmgrNick Mathewson2020-11-021-4/+16
|
* Add a new circuit-manager crate and move path selection there.Nick Mathewson2020-11-021-0/+74