| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
This specifically applies the `sensitive` wrapper in the places
where we're logging target addresses at level "info" or higher.
|
| | |
|
| |
|
|
|
| |
Remove all `use` statements for `TryFrom` and `TryInto`. These are
now redundant in Rust 2021.
|
| |
|
|
|
| |
(Also, blame clock skew when it is an explanation of why we cannot
finish a connection.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |\
| |
| |
| |
| | |
implement IsolationHelper for StreamIsolation
See merge request tpo/core/arti!434
|
| | | |
|
| | | |
|
| | | |
|
| |\ \
| | |
| | |
| | |
| | | |
arti-client, dirmgr: Initial DirFilter code
See merge request tpo/core/arti!431
|
| | |/
| |
| |
| |
| | |
This will make it possible to implement a directory-munging
mechanism in arti-testing for #397.
|
| |/
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |\
| |
| |
| |
| | |
new api for isolation
See merge request tpo/core/arti!377
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
it seems I added conditional compilation without noticing it??
and there was some errors when choosing a prefered runtime depending on
feature flags
|
| | |
| |
| |
| | |
this also removes JoinResult
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
See rationale in the comment.
|
| |/
|
|
| |
See commentary for the rationale.
|
| | |
|
| |\
| |
| |
| |
| | |
Replace many manual trait impls with use of educe
See merge request tpo/core/arti!375
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously they returned an Arc, which wasn't necessary unless the
client actually _wanted_ a new Arc.
This would be an API break, except that these functions are marked
'experimental-api', so semver does not apply; nonetheless I've noted
the break in semver_status.md, just in case we care.
Closes #369
|
| |\ \
| |/
|/|
| |
| | |
Alternative DirProvider setup
See merge request tpo/core/arti!347
|
| | |
| |
| |
| | |
Put it behind experimental_api.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch removes the EventStream associated type and the Runtime
parameter. The Runtime parameter wasn't actually used for anything,
and the EventStream was easy enough to replace with a BoxStream in
this case.
Also replaced DirBootstrapEvents with a BoxStream to avoid tying
anything to our backend.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This makes using the `PreferredRuntime` the first-class option inside
`arti-client`, freeing users who don't want to think about runtimes from
having to do so.
`TorClient::create_unbootstrapped` and `builder` now automatically
use this runtime, leaving only `builder_custom` for users who wish to
manually specify a runtime.
This lets us clean up the docs a lot: mentions of using custom runtimes
are now relegated to nearer the end of the crate-level documentation,
and we mostly just link to `tor_rtcompat`'s docs to explain more there.
Instead, we take some more time to explain how you use the builder API
to create clients synchronously.
Other doc cleanups included getting rid of the explanation of `TorAddr`
in the main crate-level doc; this is already well-documented elsewhere,
and is something users should discover organically later.
fixes arti#326
|
| |\ \
| | |
| | |
| | |
| | | |
TorClient: Add get_runtime() convenience method
See merge request tpo/core/arti!350
|
| | | |
| | |
| | |
| | |
| | | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/350#note_2781368
|
| | | | |
|
| | |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`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
|
| |/
|
|
|
|
|
|
| |
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
|
| |\
| |
| |
| |
| |
| |
| | |
arti-client: add ability to automatically bootstrap
Closes #278
See merge request tpo/core/arti!322
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |/ |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
(Looks like this one got missed.)
|
| |\
| |
| |
| |
| |
| |
| | |
Allow creating unbootstrapped `TorClient`s (and `DirMgr`s)
Closes #293
See merge request tpo/core/arti!298
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |/
|
|
|
|
| |
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.
|
| |
|
|
| |
This fixes a compilation error.
|
| |
|
|
|
|
|
| |
This is closer to common usage.
(Not that we all agree with common usage, but it's closer to what
people expect.)
|
| |
|
|
|
|
|
| |
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.
|
| |\
| |
| |
| |
| | |
Hopefully uncontroversial improvements to new Error code
See merge request tpo/core/arti!291
|
| | |
| |
| |
| |
| | |
(By our convention, these errors should say what we were trying to
spawn when the error occurred.)
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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`.
|