| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
| |
RequestBody is now just an `Option<Arc<str>>` internally,
and EncodedRequest is much simpler.
|
| |
|
|
|
| |
(Also refactor the code for POST requests into a new macro,
since it would otherwise get quite duplicated.)
|
| | |
|
| | |
|
| |
|
|
|
| |
This saves a little memory, but the technique will help save more
memory for other uploads.
|
| |
|
|
|
| |
This required a change to the hsservice tests, which previously
assumed that we'd perform one write per request.
|
| |
|
|
|
| |
I'm going to use this to avoid copying when uploading large
documents.
|
| | |
|
| |\
| |
| |
| |
| | |
tor-dirclient: Support for extra-info requests
See merge request tpo/core/arti!3764
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit implements support for extra-info requests in tor-dirclient.
It is gated behind the already existing `routerdesc` feature flag,
because entities building upon router descriptors most likely also need
extra-info, namely directory mirrors and directory authorities.
The implementation is largely based upon the existing one for router
descriptors, as they are of a very similar request format, most likely
due to simply being closely related anyways.
|
| | | |
|
| |/ |
|
| |
|
|
|
|
| |
This reflects that it is expected for an HTTP GET body. It is okay
because it is only used in tor-dirmgr, which only performs GET request
anyways.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
`clippy::collapsible_if` started triggering after bumping the MSRV to
1.88.
Since this triggers from a lot of places, and since there even are a
couple of instances where we explicitly allow `clippy::collapsible_ifs`,
I've opened #2342 for deciding what to do about it.
|
| |
|
|
|
| |
This commit documents the retriability of `RequestFailedError`,
following an IRC conversation with nickm.
|
| |
|
|
| |
This adds the lint to all our crates.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
This commit removes the unused `Votable` and `Uploadable` traits and
changes the `Downloadable` trait to depend on `Requestable` rather the
sealed type, as it achieves the same level of sealedness while clearly
communicating the hierarchy.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit introduces three new traits to `tor-dirclient`:
* `Downloadable`
* `Uploadable`
* `Votable`
All of these traits have no associated methods or constants and all
require an existing implementation of `Requestable`.
The idea behind this is for applications to accept generic arguments
based upon the semantic meaning, allowing for a better integration with
proposal330.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
| |
These are all aimed at figuring out in more detail what's going on
in #2079 and related issues.
|
| |
|
|
| |
Run maint/add_warning
|
| |
|
|
| |
Part of #1885.
|
| |
|
|
| |
This feature has been removed from nightly, in favor of doc_cfg.
|
| |
|
|
| |
This is part of abolishing the use of "ns" to mean "plain".
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, run
```
git grep -l "^edition =" |
xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;'
```
Second, manually verify that all Cargo.toml files have changed,
and nothing else has changed.
Third, run cargo fmt again.
|
| | |
|
| |
|
|
|
|
| |
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.)
|
| | |
|
| |
|
|
|
|
|
| |
1) It's the last hop that matters, not the first.
2) The last hop could conceivably be virtual, making the source anonymous.
(Though this never happens in Arti today.)
|
| |
|
|
| |
See #2060.
|
| | |
|
| |\
| |
| |
| |
| |
| |
| | |
Fix clippy warnings from nightly rust
Closes #2009
See merge request tpo/core/arti!3008
|
| | |
| |
| |
| |
| |
| | |
Clippy nightly detects this problem, though earlier clippy verisons
haven't. The common element here is applying unwrap() to the result
from a write!().
|
| |/
|
|
|
|
|
|
| |
This suffix is redundant with "Accept-Encoding",
which all Tor directory caches have supported
since 0.3.1.1-alpha.
See torspec#342.
|
| |
|
|
|
|
|
|
| |
This is messy, because `ClientCirc::{path_ref, n_hops, ..}` become
fallible (we can't unwrap the result, because when a circuit is closed,
its state gets removed from the `TunnelSharedState`, but its
`ClientCirc` handle continues to exist, so any attempt to retrieve the
state will result in an `Err`).
|
| |
|
|
|
|
|
| |
MockSleepProvider and MockSleepRuntime have been declared deprecated
by the docs for some time. We're about to mark them `#[deprecated]`.
This commit has been split out for clarity of review.
|
| | |
|