summaryrefslogtreecommitdiff
path: root/crates/arti-client/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * Integrate status information at arti-clientNick Mathewson2022-01-182-40/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit combines status update information from tor-dirmgr and tor-chanmgr in the arti-client crate, so that the user can get to it; it represents a high-level view of the client's ability to reach the network and route traffic. I have omitted the tor-circmgr support for now; it's mostly not needed. At present it's not so useful, since there's no way for a client to get a TorClient that _isn't_ completely bootstrapped, and therefore there's no way to actually watch these events until they're no longer interesting. That should change with arti#293. This is part of #96.
* | Put our cache files in the right place.Nick Mathewson2022-01-181-1/+1
|/ | | | | | | This resolves a copy-and-paste error where we were putting everything in our state directory. Closes #297.
* Implement the basics of a bootstrap-status API.Nick Mathewson2022-01-133-1/+220
| | | | | | | | | | | | The purpose of a this API is to tell the user how far along Arti is in getting bootstrapped, and if it's stuck, what it's stuck on. This API doesn't yet expose any useful information: by the time it's observable to a client, it's always "100% bootstrapped." But I'm putting it in a MR now so that we can review the basic idea, and to avoid conflicts with later work on tickets like #293 and #278. This is part of #96.
* Improve the layout of crate exports; add runtime convenience functionseta2022-01-113-6/+47
| | | | | | | | | | | | | | | | | | | | This commit addresses multiple problems highlighted by arti#182: - `arti-client` had some types in its public API that weren't accessible without importing another crate (`CfgPath`, `DataReader`, `DataWriter`). This has been fixed. - In addition, the doc comments for `DataReader` and `DataWriter` were cleaned up to be of better quality, now that they're public. - It was impossible to use `arti-client` without also importing `tor-rtcompat`. This is now fixed by the addition of two convenience methods: `TorClient::bootstrap_with_tokio` and `TorClient::bootstrap_with_async_std`. - Potentially controversially: `tor-rtcompat` now returns *concrete* types from methods like `current_runtime`, instead of `impl Runtime`. - This was needed in order to actually be able to name the `TorClient` type that results from using these methods. - This does mean we lose API flexibility, but on balance I think this is a good thing, because the API we *do* have is actually usable...
* Merge branch 'ticket_281' into 'main'eta2022-01-102-18/+26
|\ | | | | | | | | | | | | Expose and rename stream timeout config. Closes #281 See merge request tpo/core/arti!231
| * Expose and rename stream timeout config.Nick Mathewson2022-01-102-18/+26
| | | | | | | | | | | | | | | | | | | | | | Previously we kept this in an ambiguously named type, `ClientTimeoutConfig`. But everything we do right now is client related! So `StreamTimeoutConfig` is a better name. Also, we'd previously neglected to expose the builder for this type from `TorClientConfigBuilder`. Now we do. Closes #281.
* | Make the arti_client::Result type public.Nick Mathewson2022-01-101-2/+2
|/ | | | Closes #280.
* Use *_with_prefs() for Option<ConnectPrefs> callers in TorClient::connectNeel Chauhan2022-01-082-10/+31
|
* tor-circmgr: Remove Arc around ClientCircIan Jackson2022-01-071-1/+1
| | | | | | See the new commentary text on `ClientCirc` for the rationale. Signed-off-by: Ian Jackson <[email protected]>
* extend lints to include 'clippy::all'Daniel Eades2021-12-281-0/+1
|
* Merge branch 'refactor/must-use-self' into 'main'eta2021-12-201-0/+1
|\ | | | | | | | | address clippy's latest lint See merge request tpo/core/arti!205
| * address clippy's latest lintDaniel Eades2021-12-201-0/+1
| |
* | arti-client: Change an XXXX to a TODO.Nick Mathewson2021-12-201-1/+5
|/ | | | | | We _do_ reject bad hostnames: just not where I once thought we might. We need to decide if the current behavior is what we want (and I think it is, probably?).
* Merge branch 'reconfigure' into 'main'eta2021-12-133-14/+108
|\ | | | | | | | | Make most arti-client fields reconfigurable. See merge request tpo/core/arti!181
| * Oops: MutCfg shouldn't implement Clone.Nick Mathewson2021-12-071-4/+7
| | | | | | | | | | | | | | | | We don't want MutCfg to be automatially coneable, or we'll wind up with surprises like the one that this patch fixes in TorClient. (The "surprise" is that reconfigure() would only apply its client-specific options to one client instance.)
| * Sequence reconfiguration requests.Nick Mathewson2021-12-071-8/+25
| | | | | | | | | | | | If we allow overlapping reconfiguration requests, we introduce all kinds of "fun" bugs. For example, we could wind up with a configuration made up of parts of one reconfiguration attempt, and parts of another.
| * Improve documentation of which config can change.Nick Mathewson2021-12-071-0/+2
| | | | | | | | | | It no longer makes sense to say "most things can't change", now that most things can.
| * Make TorClient reconfigurable.Nick Mathewson2021-12-072-15/+29
| | | | | | | | This covers ClientAddrConfig and ClientTimeoutConfig.
| * Add new configuration objects to reconfigure.Nick Mathewson2021-12-071-0/+4
| | | | | | | | | | (These weren't in the codebase when I started the first version of this branch.)
| * Allow on-the-fly changing of path_rulesNick Mathewson2021-12-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | And now the complexity begins: when the user changes the path_rules, they not only want new circuits to obey those rules: they want _all new requests_ to be put onto circuits that obey those rules. That means that when the path rules become more restrictive, we need to retire all the circuits, and make sure that currently pending circuits aren't used for any requests. If it's any comfort, doing this was even more complicated in C tor. ;)
| * Sketch API for reconfiguration.Nick Mathewson2021-12-072-4/+58
| | | | | | | | | | | | | | This patch doesn't actually make anything reconfigurable, but it does create an API that will tell you "you can't change the value of that!" If the API looks reasonable, I can start making it possible to change the values of individual items.
* | drop arcs before awaitingTrinity Pointard2021-12-091-0/+1
| |
* | fix nightly clippy errorsTrinity Pointard2021-12-091-15/+10
|/
* Make ClientTimeoutConfig members crate-private.Nick Mathewson2021-12-071-3/+3
| | | | We shouldn't have pub members in these config objects.
* Rename timeout_rules to stream_timeouts.Nick Mathewson2021-12-072-17/+18
| | | | | | | (There are other timeout rules, after all.) Also, rename stream_timeout to connect_timeout, to make it more clear when it applies.
* Merge branch 'revised_preemptive_config' into 'main'eta2021-12-071-13/+13
|\ | | | | | | | | Usability: renaming and documentation in preemptive circuit config See merge request tpo/core/arti!176
| * Rename circuits_preemptive to preemptive_circuitsNick Mathewson2021-12-071-13/+13
| | | | | | | | | | | | This obeys a few conventions: * adjective before noun * config objects end with "config"
* | Merge branch 'bug252' into 'main'eta2021-12-072-13/+89
|\ \ | |/ |/| | | | | | | | | Make DNS fields in arti-client/src/client.rs configurable Closes #252 See merge request tpo/core/arti!171
| * Rename ClientDNSConfig -> ClientTimeoutConfigNeel Chauhan2021-12-072-26/+29
| |
| * Improve ClientDNSConfig field commentsNeel Chauhan2021-12-031-3/+5
| |
| * Make DNS fields in arti-client/src/client.rs configurableNeel Chauhan2021-12-032-13/+84
| |
* | Merge branch 'preemptive-config' into 'main'eta2021-12-071-2/+21
|\ \ | | | | | | | | | | | | | | | | | | Allow configurability on preemptive circuits Closes #245 See merge request tpo/core/arti!164
| * | Allow configurability on preemptive circuitsNeel Chauhan2021-12-071-2/+21
| |/
* / Resolve roughly half of the XXXXs.Nick Mathewson2021-12-061-1/+1
|/ | | | | | | | We want to only use TODO in the codebase for non-blockers, and open tickets for anything that is a bigger blocker than a TODO. These XXXXs seem like definite non-blockers to me. Part of arti#231.
* Add constructor for TorAddr, to enforce port != 0Nick Mathewson2021-11-301-24/+30
| | | | This makes sure that we're checking for a nonzero port in all cases.
* Merge remote-tracking branch 'origin/mr/156'Nick Mathewson2021-11-301-2/+5
|\
| * arti-client: Reject Port 0 when parsing address:port combosNeel Chauhan2021-11-291-2/+5
| |
* | Merge remote-tracking branch 'origin/mr/154'Nick Mathewson2021-11-301-1/+31
|\ \
| * | Actually build preemptive circuits (and minor fixes)eta2021-11-291-1/+31
| | | | | | | | | | | | | | | | | | The new CircMgr::build_circuits_preemptively function actually causes preemptive circuits to be built; it gets called from arti-client, like the other daemon tasks the CircMgr has.
* | | Fix a documentation link.Nick Mathewson2021-11-301-2/+3
| | |
* | | Fix a bad rustdoc reference.Nick Mathewson2021-11-291-1/+1
| | |
* | | Change sane_defaults() and with_directories()Nick Mathewson2021-11-292-33/+28
| | | | | | | | | | | | | | | | | | | | | | | | The sane_defaults() call is now the same as you get from a default builder: by convention, we just call that method Default::default(). The with_directories() constructor makes more sense as a constructor for the TorClientConfigBuilder than for TorClientConfig.
* | | Merge branch 'config-updates-and-tests'Nick Mathewson2021-11-291-28/+109
|\ \ \ | |_|/ |/| |
| * | Document StorageConfig defaults better.Nick Mathewson2021-11-291-3/+17
| | | | | | | | | | | | (Also fix a couple of typos)
| * | Add basic tests for high-level buildersNick Mathewson2021-11-251-3/+52
| | | | | | | | | | | | | | | Make sure that we can change elements, and we can reconstruct builders that give us the same thing.
| * | Impl and test Default for high-level configsNick Mathewson2021-11-251-0/+20
| | |
| * | Ensure that all config sections have deny_unknown_fieldsNick Mathewson2021-11-251-0/+1
| | | | | | | | | | | | | | | When we deserialize a configuration, we should reject unknown variables (except when we have an explicit reason to allow them).
| * | Make directory accessors crate-private.Nick Mathewson2021-11-251-4/+2
| | | | | | | | | | | | These don't need to be exposed any longer.
| * | Define defaults for StorageConfigNick Mathewson2021-11-251-19/+18
| | | | | | | | | | | | | | | | | | | | | | | | I'm still not 100% sure this is the right move: should we encourage app developers to always pick their own directories? Or should we make it easy for them to use, well, `sane_defaults`? This patch takes the second approach.
* | | add semicolons if nothing returnedDaniel Eades2021-11-252-2/+3
| | |