| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
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.)
|
| |
|
|
|
| |
Replace the next delay field immediately rather than taking it and
_then_ setting it. This way, it's never in an incorrect state.
|
| |
|
|
|
|
|
|
|
|
| |
The previous algorithm had two flaws:
* It would wait even after the final attempt, when there were no
more retries to do.
* It would fail to wait between attempts if an error occurred.
This refactoring fixes both of these issues, and adds some comments.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
The FirstHopId type now records an enum that stores whether the hop
is a guard or a fallback. This change addresses concerns about
remembering to check the type or source of an Id before passing it
down to the FallbackState or GuardSet.
Making this change required an API change, so that dirmgr can
report success/failure status without actually knowing whether it's
using a fallback or a guard.
|
| |
|
|
|
| |
This is preparation for having separate GuardId and FirstHopId types
that distinguish which back-end they index.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
We do this by creating a new FallbackSet type that includes status
information, and updating the GuardMgr APIs to record success and
failure about it when appropriate. We can use this to mark
FallbackDirs retriable (or not).
With this change, FallbackDir is now stored internally as a Guard in
the GuardMgr crate. That's fine: the FallbackDir type really only
matters for configuration.
|
| |
|
|
|
|
|
| |
This is the final step in allowing the CircMgr to use the GuardMgr's
view of the fallbacks.
Compilation is restored and tests pass.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
This is the logical place for it, I think: the GuardMgr's job is to
pick the first hop for a circuit depending on remembered status for
possible first hops. Making this change will let us streamline the
code that interacts with these objects.
|
| |\
| |
| |
| |
| | |
Remove allow(clippy::disallowed_methods) lint flag.
See merge request tpo/core/arti!437
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |\
| |
| |
| |
| |
| |
| | |
Don't use SystemTime::now()
Closes #306
See merge request tpo/core/arti!365
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
This means you can write a DirFilter and only write code to mess with
the bits you want to.
Also, it is less code here.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| | |
Abolish the handwritten Debug impl for DynFilter, which is no longer
needed.
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
Pattern bindings after `@` weren't stabilized then :/
|
| | |
| |
| |
| |
| |
| | |
Some error types indicate that the guard has failed as a dircache.
We should treat these errors as signs to close the circuit, and to
mark the guard as having failed.
|
| | |
| |
| |
| |
| |
| | |
It'll soon more convenient to pass in FallbackDirs as a slice of
references, rather than just a slice of FallbackDirs: I'm going to
be changing how we handle these in tor-dirmgr.
|
| | |
| |
| |
| |
| | |
This makes this information crate-private. The crate can reasonably
just access it.
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
Using accessors for crate-only fields is otiose.
|
| | |
| |
| |
| |
| |
| | |
Rename this to be named the same as its accessor, and use the rename
feature of builder and serde. (The shorter name is nicer in the code
IMO.)
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Use less space in hashtables for microdescriptors
Closes #386
See merge request tpo/core/arti!415
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We were using a hashtable to keep track of missing microdescriptor
digests. But this information is redundant with the NetDir state,
and there's now no longer any performance benefit to keeping a
separate copy.
Part of #386.
|
| |\ \ \
| | | |
| | | |
| | | |
| | | | |
Absolish builders for CircMgrConfig and DirMgrConfig
See merge request tpo/core/arti!417
|
| | | | |
| | | |
| | | |
| | | | |
See rationale in the comment.
|
| |\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
dirmgr: Always send if-modified-since on consensus documents.
Closes #403
See merge request tpo/core/arti!412
|
| | | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We never want a consensus document that's super-old, since we would
reject it immediately for being too old.
Also, never send an if-modified-since that's so old that we'd reject
the response.
Closes #403
|
| |\ \ \ \
| |_|/ /
|/| | |
| | | |
| | | | |
derive_builder: Switch to upstream 0.11
See merge request tpo/core/arti!414
|
| | |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This has the different syntax for builder field attributes than what I
originally proposed in my MR, and which therefore is in the pinned
branch.
My upstream MR for the field attributes feature was morged:
https://github.com/colin-kiegel/rust-derive-builder/issues/239
|
| | | |
| | |
| | |
| | | |
Instead, check initial_delay in dirmgr directly.
|
| | | |
| | |
| | |
| | | |
It wasn't necessary.
|
| | | |
| | |
| | |
| | |
| | | |
It's no longer about downloads; it's about whatever you need to
retry.
|
| | | |
| | |
| | |
| | |
| | | |
This (almost) a pure code-movement commit: it also makes one public
function private in order to suppress a warning.
|
| |/ /
| |
| |
| |
| | |
We'll need these for our unit tests in tor-dirmgr once we move
RetryDelay into tor-basic-utils.
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | | |
dirmgr: Call shrink_to_fit on missing-microdesc hashtable
Closes #388
See merge request tpo/core/arti!399
|