aboutsummaryrefslogtreecommitdiff
path: root/tor-dirclient/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Add accessors for members of different directory requestsNick Mathewson2021-04-012-35/+63
| | | | | | | | This will let us use these types both as client and server-side implementations. Making this change required me to change the download code to take requests by reference. (Sorry, David)
* Rename ClientRequest to Requestable.Nick Mathewson2021-04-012-8/+8
|
* Rename ServerDescriptorRequest to RouterDescRequestNick Mathewson2021-03-301-7/+7
| | | | | Rationale: the name of the request should match the name of the type that you parse from it.
* ServerDescriptorRequest: handle "all.z" case differentlyNick Mathewson2021-03-301-7/+25
| | | | | | Having "no descriptors" mean "all of them" is kind of an accident waiting to happen, and had wrong behavior for partial_docs_ok() and max_response_len().
* fix clippy warnings in request.rsNick Mathewson2021-03-301-5/+2
|
* Move RdDigest to routerdesc.rsNick Mathewson2021-03-301-1/+1
|
* dir: Add server descriptor directory requestDavid Goulet2021-03-301-0/+60
| | | | Signed-off-by: David Goulet <[email protected]>
* Fix Rust-1.51 clippy warnings about acronyms in camel case.Nick Mathewson2021-03-292-4/+4
| | | | This is painful, but we shouldn't have to do it again.
* Rename Rsa{Identity,Signature} to fix clippy warning.Nick Mathewson2021-03-291-4/+4
|
* Refactor errors in tor-decompress and tor-dirclient.Nick Mathewson2021-03-244-67/+104
| | | | | This lets us reinstate the code in dirclient that retired circuits depending on the error type.
* dirclient: add a function to download over a stream.Nick Mathewson2021-03-242-70/+88
| | | | | Also, remove references to DataStream, and comment on the future of the module.
* Use AsyncRead and AsyncWrite in tor-dirclientNick Mathewson2021-03-101-4/+8
|
* Remove an unwrap in dirclient.Nick Mathewson2021-03-041-40/+41
|
* Move content-encoding handling to decompressNick Mathewson2021-03-041-62/+2
| | | | This way tor-dirclient doesn't need to link to the compression crates.
* Moves decompress related code into tor-decompress crateKushal Das2021-03-042-263/+3
| | | | | The related data structures are marked as public in the tor-decompress crate so that tor-dirclient can access them.
* Port to work with tokio or async-std.Nick Mathewson2021-03-021-1/+2
| | | | | | | | | | | | | | | | | | This is fairly ugly and I think I'll need to mess around with the feature configuration a while until we get something that's pleasant to develop with. This still seems like a good idea, though, since we _will_ need to be executor-agnostic in the end, or we'll have no way to handle wasm or embedded environments. Later down the road, we'll probably want to use futures::Executor or futures::Spawn more than having global entry points in tor_rtcompat. That would probably make our feature story simpler. Tokio is the default now, since tokio seems to be more heavily used for performance-critical stuff. This patch breaks tests; the next one will fix them, albeit questionably.
* Merge remote-tracking branch 'origin/mr/12' into mainNick Mathewson2021-01-271-2/+9
|\
| * Add an error type check in test_get_decompressor_err in tor-dirclienthiro2021-01-251-2/+9
| |
* | A few more tests in request.rsNick Mathewson2021-01-261-5/+9
|/
* Add a test for consensus requests in tor-dirclient.hiro2021-01-221-0/+25
|
* Fix a test in tor-dirclientNick Mathewson2021-01-211-2/+2
|
* Merge remote-tracking branch 'origin/mr/10' into mainNick Mathewson2021-01-213-2/+108
|\
| * Reformats the code and removes extra returnKushal Das2021-01-211-5/+10
| | | | | | | | Based rust nightly cargo fmt.
| * Adds decompress_in_parts_zstd testKushal Das2021-01-211-0/+37
| | | | | | | | | | | | Now we are testing decompression of the input via calling the process method 3 times. We get the final decompressed output only after the third call.
| * Adds decompression test for zstdKushal Das2021-01-211-0/+27
| | | | | | | | Tests the decompression of the whole input in one go.
| * Adds zstd decompression implementation for dirclientKushal Das2021-01-213-2/+39
| | | | | | | | Adds dependency to zstd crate.
* | Add a test for encoding authcert requestsNick Mathewson2021-01-211-0/+28
| |
* | Add a little testing in tor-dirclientNick Mathewson2021-01-214-2/+64
|/
* Basic test for tor-dirclient::utilNick Mathewson2020-12-211-0/+25
|
* Run cargo fmtNick Mathewson2020-12-171-1/+4
|
* Merge branch 'mr_1_squashed' into mainNick Mathewson2020-12-173-4/+46
|\
| * Fixup! issue #34: adding support for xz2owen662020-12-103-14/+16
| |
| * issue #34: adding support for xz2owen662020-12-022-0/+40
| |
* | Use anyhow crate to add extra context for various dirclient errors.George Kadianakis2020-12-102-9/+26
| |
* | Fix some rustdoc warnings.Nick Mathewson2020-12-091-1/+2
| |
* | De-parameterize ChanMgr and everything that wraps it.Nick Mathewson2020-12-081-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes a whole lot of our code simpler, and makes it so that CircMgr and DirMgr no longer need to have anything parameterized over transports, either. Instead of boxing Transport inside of ChanMgr, I've made a new Connection trait that goes from a ChanTarget* straight to a Channel. This lets us avoid having to box the intermediate TLS object. [*] Actually, a copy of the information from a ChanTarget. Ick, but I had to make a copy to avoid parameterizing Connecter::build_channel.
* | Tolerate attempt to write a non-UTF-8 HTTP header.Nick Mathewson2020-12-071-2/+6
| | | | | | | | previously, we would panic.
* | Mark some XXXX issues as XXXX-A1.Nick Mathewson2020-12-073-3/+2
| |
* | tor-dirclient: tweak so that its future is Send.Nick Mathewson2020-12-041-2/+2
| |
* | Fix a couple of clippy warnings in tor-dirclient.Nick Mathewson2020-12-022-2/+3
| |
* | Abandon directory circuits on most kinds of directory failure.Nick Mathewson2020-12-022-21/+164
|/ | | | | (There are more cases that this _doesn't_ handle, but it's a start for now.)
* tor-dirclient: add timeoutsNick Mathewson2020-12-012-5/+38
| | | | | | | | This adds two timeouts in total: one for sending begin, and getting headers, and one for getting the rest of the data. These timeouts are way too long right now, but at least the code is there.
* Implement a maximum length for directory responsesNick Mathewson2020-11-253-4/+31
|
* Extract another function in tor-dirclientNick Mathewson2020-11-251-16/+28
|
* Better error types for tor-dirclientNick Mathewson2020-11-253-8/+32
|
* tor-dirclient: add support for partial documents.Nick Mathewson2020-11-252-38/+86
| | | | | | Some requests are still useful when we get only a partial response -- like those where we're asking for a bunch of documents at once. For those, we should return any nonempty partial result.
* missing docs in tor-dirclientNick Mathewson2020-11-232-0/+4
|
* Require (and write) docs in tor-dirclient.Nick Mathewson2020-11-203-7/+97
|
* Initial pass on directory-manager code.Nick Mathewson2020-11-192-5/+7
| | | | | | | | This code can now bootstrap from the network, cache the results, and reload from cache. There's lots more work to do here, including a big pile of tidying and refactoring and testing and documentation.
* Add support for using fallback directories in path constructionNick Mathewson2020-11-191-3/+2
| | | | | | This is mainly a refactoring commit, with a little new code. It also adds #[derive(Copy,Clone)] for a few types.