summaryrefslogtreecommitdiff
path: root/crates/arti-client/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | TorClient:runtime(): rename from get_runtimeIan Jackson2022-02-251-1/+1
| | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/350#note_2781368
| * | TorClient: Add get_runtime() convenience methodIan Jackson2022-02-241-0/+11
| | |
* | | arti-client: Unlock the state manager on failure to bootstrapeta2022-02-243-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `StateMgr` got a new `unlock()` method that does what it says on the tin. We now call it from `bootstrap()` using the new `util::StateMgrUnlockGuard`, which works in a manner similar to the `BoolResetter` from `tor_dirmgr`. (A decent small little task in future might be to unify these types in some sort of general arti utility crate?) closes arti#335
* | | Merge branch 'http-layer' into 'main'eta2022-02-241-0/+8
|\ \ \ | |_|/ |/| | | | | | | | Initial cut of hyper bindings as a library crate See merge request tpo/core/arti!342
| * | impl From<TorAddrError> for tor_error::ErrorIan Jackson2022-02-231-0/+8
| |/ | | | | | | | | It auto-converts to ErrorDetail but add this for convenience of callers which don't want to look into that unstable API.
* | Documentation suggestion from review.Ian Jackson2022-02-231-1/+1
| |
* | Make a TorClientBuilder API.Nick Mathewson2022-02-183-43/+108
|/ | | | | | | | This is a defensive API choice to protect against the possibility that we'll want to add a bunch of other non-config options in the future. Closes #350
* Merge branch 'remaining-errors'Nick Mathewson2022-02-171-2/+11
|\
| * Rename ExitTimeout to RemoteNetworkTimeout.Nick Mathewson2022-02-171-1/+1
| |
| * arti_client: provide Kinds for all errors.Nick Mathewson2022-02-161-1/+10
| |
* | Merge branch 'eta/lazy-init' into 'main'eta2022-02-162-14/+76
|\ \ | |/ |/| | | | | | | | | arti-client: add ability to automatically bootstrap Closes #278 See merge request tpo/core/arti!322
| * arti-client: add ability to automatically bootstrapeta2022-02-162-14/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | The new `BootstrapBehavior` enum controls whether an unbootstrapped `TorClient` will bootstrap itself automatically (`Ondemand`) when an attempt is made to use it, or whether the user must perform bootstrapping themselves (`Manual`). The `lazy-init` example shows how you could write a simple `get_tor_client()` function that used a global `OnceCell` to share a Tor client across an entire application with this API. closes arti#278
* | Move persistent state flush from client to circmgrYuan Lyu2022-02-151-14/+0
|/
* Merge branch 'explain_into_tor_addr' into 'main'Nick Mathewson2022-02-141-4/+25
|\ | | | | | | | | | | | | More docs for IntoTorAddr Closes #253 See merge request tpo/core/arti!305
| * More docs for IntoTorAddrNick Mathewson2022-02-141-4/+25
| |
* | Merge branch 'ticket_337' into 'main'eta2022-02-141-37/+11
|\ \ | | | | | | | | | | | | | | | | | | Simplify wait_for_bootstrap to use a Mutex. Closes #337 See merge request tpo/core/arti!308
| * | Simplify wait_for_bootstrap to use a Mutex.Nick Mathewson2022-02-141-37/+11
| |/ | | | | | | | | | | | | | | Since the only purpose of this function is to make sure that no bootstrapping task is running, a simple futures::lock::Mutex should do the job just fine. Closes #337.
* / Change deny(clippy::all) to warn(clippy::all).Nick Mathewson2022-02-141-1/+1
|/ | | | Closes #338.
* Rename bootstrap_existing to bootstrap.Nick Mathewson2022-02-112-12/+10
| | | | (Looks like this one got missed.)
* Merge branch 'eta/unbootstrapped-clients' into 'main'Nick Mathewson2022-02-113-65/+215
|\ | | | | | | | | | | | | Allow creating unbootstrapped `TorClient`s (and `DirMgr`s) Closes #293 See merge request tpo/core/arti!298
| * Allow creating unbootstrapped `TorClient`s (and `DirMgr`s)eta2022-02-113-65/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes how the `TorClient` type works, enabling it to be constructed synchronously without initiating the bootstrapping process. Daemon tasks are still started on construction (although some of them won't do anything if the client isn't bootstrapped). The old bootstrap() methods are now reimplemented in terms of the new create_unbootstrapped() and bootstrap_existing() methods. This required refactoring how the `DirMgr` works to enable the same sort of thing there. closes #293
* | Write some examples for TorClient::connect()Nick Mathewson2022-02-111-5/+64
|/ | | | | | These should explain better what you can pass as an address, and what you should do if you _really need_ to provide a SocketAddr or something.
* Update launch of chan expiration task to new APINick Mathewson2022-02-081-4/+6
| | | | This fixes a compilation error.
* ErrorDetail Simplify visibility macros a bit.Nick Mathewson2022-02-082-19/+53
| | | | | | | | Instead of declaring a macro that takes vis as an argument, we now conditionally declare a macro that applies an appropriate visibility. There's a long comment explaining the rationale here, along with a couple of other solutions that don't work.
* Rename TorResult to Result.Nick Mathewson2022-02-083-27/+28
| | | | | | | This is closer to common usage. (Not that we all agree with common usage, but it's closer to what people expect.)
* arti_client: Rename Error to ErrorDetail.Nick Mathewson2022-02-084-48/+43
| | | | | | | This is closer to what we described in Errors.md. Also, remove the (sometimes private) Result alias: it was only used in one or two places, and never exposed in public.
* TorError: Make detail() an accessor function.Nick Mathewson2022-02-081-4/+25
| | | | | | This change lets us make TorError's members unconditionally hidden, and makes our API a little more consistent (since basically nothing else is a public field).
* Merge branch 'error-improvements' into 'main'eta2022-02-083-147/+225
|\ | | | | | | | | Hopefully uncontroversial improvements to new Error code See merge request tpo/core/arti!291
| * Docs and clarification for a bunch of Error stuffNick Mathewson2022-02-042-64/+102
| |
| * Make SpawnError wrappers contain a 'spawning' stringNick Mathewson2022-02-042-36/+56
| | | | | | | | | | (By our convention, these errors should say what we were trying to spawn when the error occurred.)
| * Make the Error detail type non-exported from arti-clientNick Mathewson2022-02-043-41/+44
| | | | | | | | | | | | | | | | | | | | | | At least by default, we should have Error be private, and not expose it as part of our APIs. To keep functionality in `arti`, I had to add an `ExitTimeout` error kind. For interface consistency, I also re-exported ErrorKind and HasError from `arti_client`.
| * Test that TorError implements the right traits.Nick Mathewson2022-02-041-3/+21
| | | | | | | | | | I had planned to use assert_impl, but that can't check for the 'static lifetime.
| * Make TorError implement Clone.Nick Mathewson2022-02-041-3/+2
| | | | | | | | | | This patch makes only minimal changes in lower-level error types: we have more refactoring to do.
* | Expire channels that have been unused for too longYuan Lyu2022-02-041-0/+23
|/
* errors: Add some TODOs as per discussion commentsIan Jackson2022-02-041-0/+3
|
* errors: Drop "Error" and "Failed" from various enum variantsIan Jackson2022-02-042-3/+3
|
* Box the Error in a TorErrorIan Jackson2022-02-041-2/+10
| | | | | | This will get quite large and boxing it here is very convenient. This also avoids us exposing a large error type to our callers.
* errors: Handle exit circuit creation failure the new wayIan Jackson2022-02-042-2/+22
|
* errors: Handle circmgr setup errors differentlyIan Jackson2022-02-042-4/+5
| | | | | | | | | | | | | The motivation for doing this now is to remove the `#[from]` so we would spot where operationsl circuit setup failures were handled. (But it turns out that they are turned into internal errors!) Perhaps this will want to become a different error type from circmgr in due course, but for now we simply use a bespoke variant of TorError. It will want its own Kind. The TODO in the HasKind impl marks this (amongst much else here).
* errors: Introduce error_detail featureIan Jackson2022-02-042-3/+35
| | | | | Right now we must always expose the `Error` type since we haven't converted everything.
* errors: Refer to err::Error in some bits of arti_clientIan Jackson2022-02-044-9/+11
| | | | We are going to make the top-level Error type conditionally hidden.
* errors: Introduce TorErrorIan Jackson2022-02-043-7/+50
| | | | Still much to do here.
* errors: Initial impl HasKind in arti-client, ErrorKind::TODOIan Jackson2022-02-041-0/+7
| | | | | | | | | This involves making a temporary ErrorKind::TODO. That will continue to exist until all errors (at least, the ones that make it out to here) can be properly categorised. Introducing this will let us work from the top and bottom towards the middle.
* spawn errors: Fix arti-client, tor-chanmgr, tor-circmgrIan Jackson2022-02-041-3/+10
| | | | | | | Provide an enum variant to contain the SpawnError and a From impl. We use `#[from]` here because it doesn't really make sense to attach any context, as it's not likely to be very relevant.
* Fix typosDimitris Apostolou2022-02-021-1/+1
|
* Expose Reconfigure enum from arti-client.Nick Mathewson2022-02-011-1/+1
| | | | | This enum is required to use `TorClient::reconfigure` correctly, and as such ought to be re-exported.
* Make max_file_limit configurableNeel Chauhan2022-01-281-0/+56
|
* Fix documentation references for tor-rtcompat refactoring.Nick Mathewson2022-01-261-5/+7
|
* Make the native-tls crate optional.Nick Mathewson2022-01-261-8/+8
| | | | | | | | | | | This commit puts the native-tls crate behind a feature. The feature is off-by-default in the tor-rtcompat crate, but can be enabled either from arti or arti-client. There is an included script that I used to test that tor-rtcompat could build and run its tests with all subsets of its features. Closes #300
* Make current/create functions into runtime member functions.Nick Mathewson2022-01-262-4/+3
| | | | | This should help avoid some amount of temptation towards API proliferation.