aboutsummaryrefslogtreecommitdiff
path: root/crates/arti-client
Commit message (Collapse)AuthorAgeFilesLines
...
* | Fix grammar and typosSamanta Navarro2022-04-272-2/+2
| |
* | Merge branch 'upgrade_dependencies' into 'main'eta2022-04-271-1/+1
|\ \ | |/ |/| | | | | | | | | Upgrade various dependencies, now that we are MSRV 1.56 Closes #313 and #334 See merge request tpo/core/arti!476
| * Upgrade to Postage 0.5.0Nick Mathewson2022-04-261-1/+1
| |
* | Merge branch 'download-schedule' into 'main'Nick Mathewson2022-04-261-5/+9
|\ \ | |/ |/| | | | | DownloadSchedule: Introduce Builder See merge request tpo/core/arti!473
| * DirMgrConfig: Rename two fields that contained a _configIan Jackson2022-04-261-2/+2
| | | | | | | | This entire struct is config. This is otiose.
| * DownloadSchudule: Have NetworkConfig contain BuildersIan Jackson2022-04-261-17/+8
| | | | | | | | | | | | | | | | | | | | | | Use sub_builder. We must do something special for defaults. This involves moving the actual default values for retry_bootstrap and retry_microdescs into config.rs, since they need to access the fields of the un-built version of the structure. (An alternative would be to generate "weak setters" which do not override previous settings, but derive_builder does not offer to generate them and that seems overkill.)
| * DownloadSchedule: Abolish new() methodIan Jackson2022-04-261-3/+16
| | | | | | | | | | | | | | | | | | | | Instead, everyone should use DownloadScheduleBuilder. The new() method would in any case be useless in a moment, since we're going to embed DownloadScheduleBuilder in the NetworkConfig, not DownloadSchedule. The call sites in the tests are all about to change again.
* | Merge branch 'main' into 'msrv_1_56'Nick Mathewson2022-04-261-6/+3
|\| | | | | | | | | | | # Conflicts: # crates/tor-config/Cargo.toml # crates/tor-dirmgr/src/state.rs # doc/semver_status.md
| * Rename ThingListBuilder::replace (from set)Ian Jackson2022-04-251-2/+2
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798024
| * Introduce AuthorityListBuilder in NetworkConfigBuilderIan Jackson2022-04-251-6/+3
| | | | | | | | | | | | | | | | | | NetworkConfigBuilder needs to not contain any validated structs, so that its serde does not expose the validated details. AuthorityListBuilder is what ought to go here - and it contains Vec<AuthorityBuilder>, not Vec<Authority>. As a consequence, many places now deal with AuthorityBuilder, rather than Authority.
* | squash! Bump every crate's edition to 2021.Nick Mathewson2022-04-252-2/+0
| | | | | | | | | | Remove all `use` statements for `TryFrom` and `TryInto`. These are now redundant in Rust 2021.
* | Bump every crate's edition to 2021.Nick Mathewson2022-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | This is an automated change made with a perl one-liner and verified with grep -L and grep -l. Some warnings are introduced with this change; they will be removed in subsequent commits. See arti#208 for older discussion on this issue.
* | Add 'rust-version = "1.56"' to every Cargo.toml file.Nick Mathewson2022-04-251-0/+1
| | | | | | | | | | | | | | This change was made automatically with a perl one-liner, and confirmed with `grep -L`. The `rust-version` field itself was introduced in 1.56.0.
* | Reformat all not-yet-reformatted Cargo.toml files.Nick Mathewson2022-04-251-11/+11
|/ | | | | There are no semantic changes here; only formatting. This is in preparation for other changes (wrt MSRV and edition)
* arti-client: TorClientConfig: derive TorClientConfigBuilderIan Jackson2022-04-221-171/+41
| | | | Replace handwritten builder struct, accessors, and builder function.
* fallback list: Introduce and use FallbackListBuilderIan Jackson2022-04-221-3/+3
| | | | | | | | | Now the network fallbacks configuration wants to Deserialize a Vec<FallbackDirBuilder>, rather than validated Vec<FallbackDir>. Methods on FallbackListBuilder are as per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/462#note_2797697 mutatis mutandi for the fact that this struct has only fallbacks in it.
* Use git source for derive_builder for now, for sub_builder featureIan Jackson2022-04-211-1/+1
| | | | | | | | | | | | | | | This commitid is the current head of my MR branch https://github.com/colin-kiegel/rust-derive-builder/pull/253 https://github.com/ijackson/rust-derive-builder/tree/field-builder Using the commitid prevents surprises if that branch is updated. We will require this newer version of derive_builder. The version will need to be bumped again later, assuming the upstream MR is merged and upstream do a release containing the needed changes. We will need the new version of not only `derive_builder_core` (the main macro implementation) but also`derive_builder` for a new error type.
* arti-client: Report clock skew when it is noteworthyNick Mathewson2022-04-122-6/+47
| | | | | (Also, blame clock skew when it is an explanation of why we cannot finish a connection.)
* Bump all arti*, tor* crates to 0.2.0Nick Mathewson2022-04-011-13/+13
| | | | | | | | Not all of these strictly need to be bumped to 0.2.0; many could go to 0.1.1 instead. But since everything at the tor-rtcompat and higher layers has had breaking API changes, it seems not so useful to distinguish. (It seems unlikely that anybody at this stage is depending on e.g. tor-protover but not arti-client.)
* Reformat several Cargo.toml files with 100-char-wide lines.Nick Mathewson2022-03-301-7/+2
|
* Turn FallbackList into a real type, and store one in GuardMgr.Nick Mathewson2022-03-302-0/+7
| | | | | | | | | | | | | | The guard manager is responsible for handing out the first hops of tor circuits, keeping track of their successes and failures, and remembering their states. Given that, it makes sense to store this information here. It is not yet used; I'll be fixing that in upcoming commits. Arguably, this information no longer belongs in the directory manager: I've added a todo about moving it. This commit will break compilation on its own in a couple of places; subsequent commits will fix it up.
* Merge branch 'disallowed_lint' into 'main'eta2022-03-301-5/+1
|\ | | | | | | | | Remove allow(clippy::disallowed_methods) lint flag. See merge request tpo/core/arti!437
| * Fix a let_and_return lint violation that had somehow slipped in.Nick Mathewson2022-03-301-3/+1
| |
| * Remove allow(clippy::disallowed_methods) lint.Nick Mathewson2022-03-301-2/+0
| |
* | Make daemon tasks self-contained; introduce NetDirProvidereta2022-03-302-261/+19
|/ | | | | | | | | | | | | | | The various background daemon tasks that `arti-client` used to spawn are now handled inside their respective crates instead, with functions provided to spawn them that return `TaskHandle`s. This required introducing a new trait, `NetDirProvider`, which steals some functionality from the `DirProvider` trait to enable `tor-circmgr` to depend on it (`tor-circmgr` is a dependency of `tor-dirmgr`, so it can't depend on `DirProvider` directly). While we're at it, we also make some of the tasks wait for events from the `NetDirProvider` instead of sleeping, slightly increasing efficiency.
* Merge branch 'no-system-time' into 'main'eta2022-03-301-1/+5
|\ | | | | | | | | | | | | Don't use SystemTime::now() Closes #306 See merge request tpo/core/arti!365
| * remove most usage of SystemTime::nowtrinity-1686a2022-02-251-1/+5
| |
* | Update README.md files using readmes scriptNick Mathewson2022-03-291-0/+2
| |
* | Merge branch 'isolation-followup' into 'main'Nick Mathewson2022-03-281-12/+12
|\ \ | | | | | | | | | | | | implement IsolationHelper for StreamIsolation See merge request tpo/core/arti!434
| * | remove usage of 'token' where it's no longer a tokentrinity-1686a2022-03-271-3/+3
| | |
| * | move StreamIsolation to isolation moduletrinity-1686a2022-03-241-1/+1
| | |
| * | rename *_isolation_group to *_isolationtrinity-1686a2022-03-241-8/+8
| | |
* | | Merge branch 'main' into 'main'Ian Jackson2022-03-251-2/+0
|\ \ \ | | | | | | | | | | | | | | | | Fixed typo on arti-client README.md See merge request tpo/core/arti!432
| * | | Fixed typo on arti-client README.mdsolanav2022-03-241-2/+0
| |/ /
* | | Merge branch 'dir-filter' into 'main'Ian Jackson2022-03-254-26/+74
|\ \ \ | | | | | | | | | | | | | | | | arti-client, dirmgr: Initial DirFilter code See merge request tpo/core/arti!431
| * | | Abolish filter::DynFilter in favour of transparent DirFilterIan Jackson2022-03-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two reasons why the DynFilter newtype might be needed: 1. To impl Default. But we don't need it to impl Default since we can have an accessor which does the defaulting. 2. To hide the API. But this is usrely an unstable API. Just writing Arc<dyn> gets rid of a lot of unnecessary boilerplate and conversion code.
| * | | Make DirFilter be Debug + Send + SyncIan Jackson2022-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | Abolish the handwritten Debug impl for DynFilter, which is no longer needed.
| * | | Expose DirFilter from arti-client.Nick Mathewson2022-03-243-1/+36
| | | | | | | | | | | | | | | | | | | | This will make it possible to implement a directory-munging mechanism in arti-testing for #397.
| * | | dirmgr: Initial DirFilter code.Nick Mathewson2022-03-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This code sits behind a feature flag, and can be used to modify directories before storing them. This is part of the implementation for #397.
| * | | Reformat {arti-client,tor-dirmgr}/Cargo.tomlNick Mathewson2022-03-241-25/+37
| |/ /
* | | Merge branch 'task-scheduler-2' into 'main'eta2022-03-253-36/+113
|\ \ \ | |/ / |/| | | | | | | | Implement a periodic task scheduler, and a basic dormant mode See merge request tpo/core/arti!429
| * | Implement a periodic task scheduler, and a basic dormant modeeta2022-03-233-36/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a revised version of !397; it implements a scheduling system for periodic tasks that can be externally controlled, and then uses the external control aspect to implement a basic dormant mode (#90). More technically, the scheduling system consists of a `Stream` that periodic tasks are expected to embed in a `while` loop or similar, a way for tasks themselves to choose how long to wait until the stream next yields a result, and a handle to control this outside of the task.
* | | Move SystemConfig to arti::cfgIan Jackson2022-03-211-48/+0
|/ / | | | | | | Fixes #314, #418.
* | Alternative API for set_isolation_group().Nick Mathewson2022-03-171-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | Instead of requiring a `Box<dyn Isolation>`, it now takes either a `Box<dyn Isolation>`, or an arbitrary `T` that implements `Isolation`. This API still allows the user to pass in a `Box<dyn Isolation>` if that's what they have, but it doesn't require them to Box the isolation on their own. Part of #414.
* | Merge branch 'test-isolation' into 'main'Nick Mathewson2022-03-172-17/+19
|\ \ | | | | | | | | | | | | new api for isolation See merge request tpo/core/arti!377
| * | replace TODOs with documentationtrinity-1686a2022-03-161-2/+1
| | |
| * | accept boxed isolation in StreamPref::set_isolation_grouptrinity-1686a2022-03-161-2/+2
| | |
| * | add tests on Isolation and fix conditional compilation issuestrinity-1686a2022-03-161-1/+0
| | | | | | | | | | | | | | | | | | it seems I added conditional compilation without noticing it?? and there was some errors when choosing a prefered runtime depending on feature flags
| * | replace IsolationMap with new Isolation traittrinity-1686a2022-03-161-0/+1
| | |
| * | replace Arc with Box and use dyn-clonetrinity-1686a2022-03-161-52/+37
| | | | | | | | | | | | this also removes JoinResult