Commit Graph

30 Commits

Author SHA1 Message Date
Nick Mathewson b00ff9f110 Make zstd and xz compression optional, but on-by-default. 2021-04-21 08:37:53 -04:00
Nick Mathewson 13d4ee888f Replace tor-decompress with async-compression crate.
This lets us simplify tor-dirclient a fair bit.  Closes #79.
2021-04-13 16:27:52 -04:00
Nick Mathewson edbd54f2fd tor-dirclient: Use AsyncBufRead to simplify code a bit.
Previously we read too much data from our input, and then used the
unused portion as an initial state of a buffer for handling
subsequent data.  Yuck!  Instead we can just use an AsyncBufRead and
only read the parts we want.

This code takes some pains to never read too much data: I'd rather
just "read until the first CRLF" or have some kind of pushback
mechanism.  But for now it's probably fine.
2021-04-13 15:45:27 -04:00
Nick Mathewson 9f44408bb9 Upgrade rsa, zstd, httpdate. Remove redundant pin-project. 2021-04-05 08:26:29 -04:00
Nick Mathewson 6daf57957d Add the tor project as an author. 2021-03-17 14:43:40 -04:00
Nick Mathewson ba14d43be4 Add keywords to each Cargo.toml 2021-03-17 14:41:02 -04:00
Nick Mathewson c8481a9354 Add a description field to all our Cargo.toml files 2021-03-17 14:31:59 -04:00
Nick Mathewson 58d8472ea0 Give it a homepage everyplace. 2021-03-17 14:13:26 -04:00
Nick Mathewson 302653977d Bump dependencies with "cargo upgrade" 2021-03-06 08:55:13 -05:00
Nick Mathewson 57682f5ec1 Move content-encoding handling to decompress
This way tor-dirclient doesn't need to link to the compression crates.
2021-03-04 13:59:12 -05:00
Kushal Das bfb652e73d
Moves decompress related code into tor-decompress crate
The related data structures are marked as public in the
tor-decompress crate so that tor-dirclient can access them.
2021-03-04 22:01:42 +05:30
Nick Mathewson 8c31418500 Port to work with tokio or async-std.
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.
2021-03-02 11:55:09 -05:00
Nick Mathewson 568567c5e0 Update to latest futures, once_cell 2021-02-23 15:54:29 -05:00
Nick Mathewson ab9d4a2229 Update some dependencies. 2021-02-19 09:39:23 -05:00
Nick Mathewson e1c3f550d8 upgrade a few dependencies 2021-02-10 18:23:38 -05:00
Nick Mathewson 243880473f bump serde and log 2021-02-01 16:39:07 -05:00
Kushal Das 55f5d2aa6a
Adds zstd decompression implementation for dirclient
Adds dependency to zstd crate.
2021-01-21 21:03:45 +05:30
Nick Mathewson 3f455e6f30 require latest futures crate 2021-01-15 17:05:05 -05:00
Nick Mathewson fa57fb4995 Upgrade a few more dependencies. 2021-01-13 08:17:14 -05:00
Nick Mathewson 7e843de2c8 Upgrade a few dependencies. 2021-01-13 08:14:28 -05:00
Nick Mathewson f01d641ec8 cargo upgrade. 2020-12-30 15:59:33 -05:00
Nick Mathewson ccd6cbf627 upgrade to latest anyhow 2020-12-21 10:21:24 -05:00
Nick Mathewson 5057cbc12f Cargo-upgrade a few dependencies 2020-12-21 10:18:41 -05:00
Nick Mathewson 8b5630e6b1 Merge branch 'mr_1_squashed' into main 2020-12-17 16:04:27 -05:00
Nick Mathewson 17c84fd59e upgrade to require latest anyhow. 2020-12-08 17:26:19 -05:00
owen66 c9a202c7ac issue #34: adding support for xz2 2020-12-02 01:20:24 +00:00
Nick Mathewson f5f2a648a3 tor-dirclient: add timeouts
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.
2020-12-01 08:56:25 -05:00
Nick Mathewson 995f136ec1 Better error types for tor-dirclient 2020-11-25 11:11:40 -05:00
Nick Mathewson aee76da70f tor-dirclient: add support for partial documents.
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.
2020-11-25 10:53:01 -05:00
Nick Mathewson 33f070e7b5 Start a directory client implementation
It can send a GET request on a circuit, get an answer, and
decompress it with zlib.

It will need documentation and tests eventually, as well as serious
refactoring.
2020-11-16 16:39:16 -05:00