| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
This commit fixes the previous check to only fail on empty GET
responses. For this, it introduces a `method` field into
`DirResponse`, which is required to determine the method there.
Doing this is reasonable for an HTTP client, as responses have different
meanings depending on the request method used.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit disallows empty responses with a status code 200.
From a pure HTTP level, this is totally valid, but it does not make any
sense in the context of the Tor directory protocol, where an empty
response only makes sense with a 404.
The motivation for this is that a work-in-progress
tor_dirclient::send_request wrapper for tor-dirserver passes the
response into the parse2 multiple function which returns a Vec<T>.
Interfacing code would then always have to check for an empty length and
do respective error handling, which should already fail at an earlier
level (tor-dirclient) instead.
|
| |
|
|
|
| |
This commit documents the retriability of `RequestFailedError`,
following an IRC conversation with nickm.
|
| |
|
|
|
|
| |
This commit improves upon the error logging of the `tor-dirclient` crate
in order to not just log the location/source of an error but also the
actual reason of an error.
|
| |
|
|
|
|
| |
This entirely removes the requirement on ClientCirc.
Signed-off-by: David Goulet <[email protected]>
|
| | |
|
| |
|
|
|
| |
These errors are suspicious as hsdir inflation attacks, in the
context of prop360.
|
| |
|
|
| |
(This was previously called a parse error, which isn't right.)
|
| | |
|
| |
|
|
|
|
|
|
| |
The HTTP status text is often useful for diagnosing errors. Tor
directory and hsdir caches frequently put useful messages there,
especially when rejecting an uploaded document.
Inspired by #1142.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Since not everybody has xz and/or zstd, we don't want to admit
whether we support them when we are uploading or downloading an
onion service descriptor. Similarly, if we aren't advertising
support for an encoding, we shouldn't accept it.
Finally, while we're doing this, it made sense to have the ability
to mark requests based on how anonymized they are, and reject (some)
attempts to send those requests over a one-hop circuit.
Closes #1062
|
| |
|
|
| |
These are newly present on 1.65. We can address them later.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
We're going to have functions on Response that fail by returning only
one of these.
Sadly this diff is quite noisy.
|
| |
|
|
|
|
|
| |
These errors no longer use Debug to dump the `Option<SourceInfo>`, but
instead produce reasonable text. Also, I've fixed the SourceInfo
Display implementation so that it now says that it got the error
"from $source via $circuit" rather than the other way around.
|
| |
|
|
|
| |
(It makes sense to use this for things that are not in fact lists of
SHA256 digests of Microdescriptors.)
|
| |
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
This will help implement #466.
|
| |
|
|
|
|
|
|
|
|
| |
This commit refactors the dirclient error type into two cases:
errors when constructing a circuit, and errors that occur once we
already have a one-hop circuit. The latter can usually be
attributed to the specific cache we're talking to.
This commit also adds a function to expose the information about
which directory gave us the info.
|
| |
|
|
|
|
| |
This is still not as specific as we want; but there's already a TODO
comment in tor-dirclient::err about fixing that at some point in the
future.
|
| |
|
|
|
|
|
| |
Getting a non-200 status is no longer a failure condition; it's just
a different kind of answer.
Closes #349.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This patch makes only minimal changes in lower-level error types:
we have more refactoring to do.
|
| | |
|
|
|
This will cause some pain for now, but now is really the best time
to do this kind of thing.
|