| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | | |
| | | |
| | | |
| | | | |
The two call sites become clearer, IMO.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We're going to use these in a moment.
One returns entries and the other statuses simply because that's
what's actually going to be wanted.
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/587#note_2815945
|
| | | | | |
|
| |\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
Error refactoring: bytes, cert, proto.
See merge request tpo/core/arti!604
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Some of these were for decoding particular objects (we now say
what kind of objects), and some were unrelated tor_cert errors that
for some reason we had shoved into a tor_bytes::Error.
There is now a separate tor_cert::CertError type, independent from
tor_cert's use of `tor_bytes::Error` for parsing errors.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Failing to encode is fundamentally different from failing to
decode. We now treat those separately, and describe _what_ we failed
to encode or decode.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This avoids adding additional information for now; that will come on
the next commits.
|
| | | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Since there is currently only one error type that can occur when
encoding, it doesn't make sense to use the full Error type here.
This split will help us downstream, as we no longer need to
categorize tor_bytes::Error as "an error in encoding or decoding".
I considered renaming Error to DecodeError, but that had pretty huge
downstream effects, and didn't seem to be worth it.
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| |\ \ \ \
| |/ / /
|/| | |
| | | |
| | | | |
Replace `base64` crate with `base64ct` crate in `tor-netdoc`
See merge request tpo/core/arti!600
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
These tests are borrowed from other parts of the `tor-netdoc`
crate.
|
| | | | |
| | | |
| | | |
| | | | |
Request for changes: `https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/600#note_2816252`
|
| | | | |
| | | |
| | | |
| | | | |
As per request, here: `https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/600#note_2816252`
|
| | | | | |
|
| | |/ /
| | |
| | |
| | |
| | |
| | |
| | | |
Note: the `base64ct` crate rejects invalid characters when the
decoding is done on padded strings. However, the `FromStr` impl
for `B64` can have both padded **and** unpadded inputs, so all
inputs are now padded first, before decoding.
|
| |\ \ \
| |/ /
|/| |
| | |
| | | |
Error cleanup, part 1
See merge request tpo/core/arti!601
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
(The use of Cow<> in the error message isn't strictly necessary
here, but it's a pattern I want to encourage.)
|
| | | |
| | |
| | |
| | |
| | | |
Also note an issue with the design of tor-bytes::Error that should
probably go in a separate MR.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | | |
This is one I missed earlier.
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | | |
These changes make sure that the errors conform to our preferred
style, and include a description of what exactly we were doing when
something went wrong.
|
| |\| |
| | |
| | |
| | |
| | | |
Do not include error source() in display() format.
See merge request tpo/core/arti!598
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
According to doc/Errors.md, and in keeping with current best
practices, we should not include display an error's `source()` as
part of that error's display method. Instead, we should let the
caller decide to call source() and display that error in turn.
Part of #323.
|
| |\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Detect and report stalled directory downloads
Closes #468
See merge request tpo/core/arti!587
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
AttemptId is now linked to DirStatus in StatusEntry.
DirBootstrapStatus now has an inner enum to make invalid status
unrepresentable.
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
I believe this type was made public in error: No other crate uses it,
and no API exposes it.
|
| | | | |
| | | |
| | | |
| | | | |
Closes #468.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The `DirBootstrapStatus` type now exposes a blockage() method to
return an `Option<DirBlockage>`.
The blockage types reported are more low-level than I'd like, but
they are IMO good enough for now: we'll want to get experience with
actual vs hypothetical problems before we refine them.
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
If there was no partial information, then calling update_progress
will now report a stall in this case, which is not what we want.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
A "reset" happens whenever we have to start a download attempt over
-- either because we ran out of retries, or we found something wrong
with the consensus after fetching certificates.
An "error" happens when we have a recoverable error from one or more
directory sources.
A "stall" happens whenever a round of downloads or cache loads leads
to no change in the status.
We don't yet use this as part of our status reporting.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Previously we used the "if-modified-since" time associated with the
consensus download, and/or the "valid-after" time in the consensus
attempt, to put multiple attempts into sequence, and to tell one
from another. But that approach was always a kludge, and will soon
get more unreliable as the DirStatus logic gets a bit more complex.
With this commit, we change separate download attempts to be
identified with an AttemptId that increments whenever we decide to
get a different directory from the one we have. IMO this new code
is _much_ cleaner.
|
| | | | |
| | | |
| | | |
| | | | |
This is all crate-internal APIs, fortunately.
|
| | | | | |
|