summaryrefslogtreecommitdiff
path: root/tor-chanmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* Remove most (all?) panics from tor-chanmgr::mgr::mapNick Mathewson2021-06-191-10/+22
| | | | | Improve testing for cases where change_state() is given a bad function.
* Make a few error types implement CloneNick Mathewson2021-06-141-2/+9
| | | | | | | 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.
* linkspec: Define owned variants of ChanTarget and CircTarget.Nick Mathewson2021-06-132-65/+6
|
* Add noop_method_call warning.Nick Mathewson2021-05-271-0/+1
| | | | | | 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.
* Use the "typos" tool to fix some spellingNick Mathewson2021-05-262-2/+2
|
* Enable cargo_common_metadata warning.Nick Mathewson2021-05-251-0/+1
|
* Module docs for remaining cratesNick Mathewson2021-05-251-2/+9
|
* Add the "unreachable_pub" lint.Nick Mathewson2021-05-183-12/+14
| | | | | | 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.
* Prefer "relay" to "server" when appropriate.Nick Mathewson2021-05-182-2/+2
|
* Fix documentation warnings.Nick Mathewson2021-05-051-1/+1
|
* Add trait_duplication_in_bounds warning.Nick Mathewson2021-05-031-0/+1
|
* Add unseparated_literal_suffix lint, and fix it.Nick Mathewson2021-05-031-0/+1
|
* Add a few more clippy warningsNick Mathewson2021-05-031-0/+5
|
* Make the MockNetProvider builder non-consuming.Nick Mathewson2021-05-031-14/+11
|
* Split mocking parts of rtcompat into new rtmock crate.Nick Mathewson2021-05-031-4/+2
| | | | | Since these parts are testing-only, let's take steps to make sure we don't ship them in production by accident.
* Much-improved tests for tor_chanmgr::builderNick Mathewson2021-04-303-1/+146
| | | | | | 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.
* Add some more clippy warnings to our list.Nick Mathewson2021-04-271-1/+6
|
* Enforce (and obey) clippy lints about exhaustive enums, structs.Nick Mathewson2021-04-272-0/+4
| | | | | | | | 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).
* cargo fix --edition-idiomsNick Mathewson2021-04-261-1/+1
|
* Another test in ChanMgr, for TargetInfo.Nick Mathewson2021-04-231-0/+19
|
* Refactor and simplify ChanMgr to use AbstractChanMgr.Nick Mathewson2021-04-237-674/+170
|
* Full documentations on the new parts of ChanMgr.Nick Mathewson2021-04-232-24/+157
|
* Start on tests for reactored ChanMsg.Nick Mathewson2021-04-233-50/+350
|
* Begin refactoring ChanMgr to have better separation of concernsNick Mathewson2021-04-224-0/+290
| | | | | Additionally: Use futures::future::Shared instead of event_listener.
* Stop using anyhow in tor_chanmgr.Nick Mathewson2021-04-223-16/+33
| | | | | It seemed like a good idea at first, but we need to be able to tell the difference between these error types more easily.
* Remove the no-longer-needed "global runtime" code.Nick Mathewson2021-04-171-16/+16
|
* Move timer functions into an extension trait.Nick Mathewson2021-04-171-7/+5
|
* Move around the public modules in tor_rtcompat.Nick Mathewson2021-04-174-5/+5
|
* Remove all non-runtime methods in tor_rtcompat.Nick Mathewson2021-04-162-5/+14
|
* Add a "Runtime" parameter to all the manager types.Nick Mathewson2021-04-161-9/+22
| | | | | This is a big change, but it is a step towards our goal of removing tor_rtcompat:: calls directly.
* rtcompat: Make TLS functionality use Runtime traits.Nick Mathewson2021-04-164-23/+7
| | | | | Now there is nothing in principle that you couldn't access from a Runtime implementation.
* Rename Rsa{Identity,Signature} to fix clippy warning.Nick Mathewson2021-03-293-7/+7
|
* Move responsibility for knowing about TLS into tor_rtcompat.Nick Mathewson2021-03-234-48/+27
| | | | Now we don't need runtime-specific stuff in tor-chanmgr.
* Refactor tokio implpementation in tor-rtcompat.Nick Mathewson2021-03-231-26/+1
| | | | | | | | | | | 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.
* Missing doc for private memberNick Mathewson2021-03-021-0/+3
|
* Update docs wrt tokio a bitNick Mathewson2021-03-021-0/+3
|
* Make a few async_test tests work correctly again.Nick Mathewson2021-03-021-122/+131
| | | | | | 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.
* Port to work with tokio or async-std.Nick Mathewson2021-03-022-14/+44
| | | | | | | | | | | | | | | | | | 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.
* Use anyhow::Context in tor-chanmgr.Nick Mathewson2020-12-112-3/+9
|
* It is an internal error if we do a TLS connection and get no cert.Nick Mathewson2020-12-081-3/+4
|
* Make RSAIdentity implement Copy.Nick Mathewson2020-12-081-1/+1
|
* De-parameterize ChanMgr and everything that wraps it.Nick Mathewson2020-12-082-40/+113
| | | | | | | | | | | | | | 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.
* Mark some XXXX issues as XXXX-A1.Nick Mathewson2020-12-071-1/+1
|
* Run cargo fix --edition-idiomsNick Mathewson2020-12-021-4/+4
|
* Refactor first-hop handling types a bitNick Mathewson2020-11-174-9/+18
| | | | | | 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.
* Turn the channel "closed" method into an AtomicBoolNick Mathewson2020-11-132-3/+3
| | | | This lets us make the test for closed channels non-async.
* Move a few immutable fields from ChannelImpl outside the lock.Nick Mathewson2020-11-132-6/+5
| | | | | Since these don't change while the channel is alive, we don't need the lock to protect them.
* Make the Arc-ness of channels more explicit.Nick Mathewson2020-11-122-24/+21
| | | | | | Previously every channel was a secret Arc<>, which I think is bad style, and which stopped us from using weak references in other places.
* tor-chanmgr: timeout support.Nick Mathewson2020-11-112-7/+21
|
* Isolate async_std usage in a new tor_rtcompat crate.Nick Mathewson2020-11-113-27/+13
| | | | | 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.