| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is actually a number of *attempts* not a number of *retries*.
The setter method was already called "attempts".
This chnages the deserialisation of the config.
|
| | | | |
| | | |
| | | |
| | | | |
We can just make the fields pub(crate).
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.)
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The current behaviour is to treat 0 as indicating "use the default",
which is quite strange. We are going to get rid of that.
The new way will be to reject zero, during
DownloadScheduleBuilder::build, Add a test case for that.
|
| | | | | |
|
| |\| | |
| | | |
| | | |
| | | |
| | | |
| | | | |
# Conflicts:
# crates/tor-config/Cargo.toml
# crates/tor-dirmgr/src/state.rs
# doc/semver_status.md
|
| | |\ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
Introduce macro for ThingListBuilder, and use for AuthorityListBuilder
See merge request tpo/core/arti!471
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Because the macro output is private, if we miss one out of the tests,
it doesn't fail due to dead code :-).
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Really, we probably don't want any of these not to be pub, but it
triggers "unreachable pub" in my test cases, and making it not pub by
mistake seems not very serious, and likely to be noticed.
Making the struct private in the test cases has the useful effect of
checking that all the methods are tested.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
I don't think we need to bother with things in the prelude,
but doing it for serde and ConfigBuildError seems nice.
Noticed while writing a test case.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
And add an imprecation in define_list_config_builder's doc comment do
do so in future for other invocations of the macro.
Add add the missing full stops.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798027
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Requested in
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798022
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798026
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798024
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798020
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This means that `NetworkConfig::initial_predicted_ports` is now like
the other list-like things, returning `&mut list_builder` with the same
`set()` and `append()` methods.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This will be useful especially for simple lists where the entry
doesn't need a separate builder type.
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This replaces two almost-identical sets of structs and impls. More
are on the way, as per
https://gitlab.torproject.org/tpo/core/arti/-/issues/447
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Since "logfiles: Introduce LogfileListConfigBuilder", this code is in
LogfileListConfigBuilder::build(), which is called by derive_builder's
generated LoggingConfig::build(), and which will add a file context
itself due to the `sub_builder` feature.
So this is otiose. And, we are about to replace this whole thing with
macro_rules-generated code (which won't do this).
|
| | |\ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
retry-error: Provide AbsRetryTime::from_sub and use it
See merge request tpo/core/arti!470
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
As requested in
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/470#note_2798015
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/470#note_2797945
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
This same calculation was in the code three times.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Remove all `use` statements for `TryFrom` and `TryInto`. These are
now redundant in Rust 2021.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| |/ / / / /
| | | | |
| | | | |
| | | | |
| | | | | |
There are no semantic changes here; only formatting. This is in
preparation for other changes (wrt MSRV and edition)
|
| |\| | | |
| |/ / /
|/| | |
| | | |
| | | | |
Better handling of integer overflows
See merge request tpo/core/arti!466
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
If duration addition overflows, then continue with Never.
Caching the AbsRetryTime constructed with duration from supplied
function also reduces the overhead of earliest_absolute.
|
| | |/ /
| | |
| | |
| | |
| | | |
In theory n_errors could overflow, which is an error in Rust.
The check is cheap and I have added a test for it.
|
| |\ \ \
| | | |
| | | |
| | | |
| | | | |
Authority: make v3ident public under experimental-api
See merge request tpo/core/arti!463
|
| | | | | |
|
| |\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
tor-basic-utils: Add RetryDelay::reset test
See merge request tpo/core/arti!467
|
| | | |/ /
| |/| | |
|
| |/ / / |
|
| | | |
| | |
| | |
| | | |
Replace handwritten builder struct, accessors, and builder function.
|
| | | |
| | |
| | |
| | | |
Replace handwritten builder struct, accessors, and builder function.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/462#note_2797697
we decided not to do this.
However, having looked again at the way the FallbackList works, I
think there is a lot of value in making these two things (and anything
else like them[1]) as similar as possible.
[1] At least PreemptiveCircuitConfig.initial_predicted_ports and
NetworkConfig.authorities need the same treatment, and perhaps also
GuardUsage.restrictions (although there is no
GuardRestrictionBuilder).
In the irc discussion I imagined `LogfilesConfigBuilder` as opposed to
`LogfileConfigBuilder` (differing only in the `s`) which would be bad,
but we can use `List` instead.
We do *not* need to abstract away the validated version of the config.
Providing a type alias helps the derive_builder sub_builder DTRT
without needing special overrides.
I have split this commit so that we can drop it, if we conclude it's
not wanted.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Change LoggingConfigBuilder to contain Vec<LogfileConfigBuilder>,
not Option<Vec<LogfileConfig>>. That makes it sane to Deserialize.
Replace LoggingConfigBuilder's file(Vec<>) setter with the methods
discussed in
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/462#note_2797697
|
| | | |
| | |
| | |
| | |
| | | |
It's a plural, and that fact is going to be exposed via serde, if it
isn't already.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is where the FallbackList type is. We are going to want to
provide a builder too, which ought to impl Default.
This means that the default value for the type must be next to the
type. In any case, it was anomalous that it wasn't.
This commit is pure code motion.
|
| | | |
| | |
| | |
| | | |
We are going to be using sub-field builders.
|
| |/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| | |
Typos found with codespell.
|