Commit Graph

3755 Commits

Author SHA1 Message Date
Nick Mathewson 58869194f6 tor-dirclient: tweak so that its future is Send. 2020-12-04 13:16:52 -05:00
Nick Mathewson 9418838456 Fix a copy-paste bug in netstatus::Lifetime 2020-12-04 13:15:58 -05:00
Nick Mathewson 4ac4f5496e rtcompat: add a function to sleep until a given wallclock time
(We can't just subtract and sleep, since we should be at least
somewhat concerned about clock jumps.)
2020-12-04 13:12:45 -05:00
Nick Mathewson 40ac33bde2 Upgrade async-io 2020-12-03 13:05:51 -05:00
Nick Mathewson be23950f37 TODO 2020-12-03 10:12:54 -05:00
Nick Mathewson 2e0c6f900b A few more tests for role-based weighting 2020-12-02 18:05:12 -05:00
Nick Mathewson b793e0c075 Use bwweightscale to avoid miscalculating weights for v2dir relays 2020-12-02 17:54:22 -05:00
Nick Mathewson 1d6d9b9c4b More tests for weight.rs; find a bug. 2020-12-02 17:39:34 -05:00
Nick Mathewson 49fc20426a Add a few easy tests in weights.rs 2020-12-02 16:57:37 -05:00
Nick Mathewson 42c85026f3 a little more refactoring for testability 2020-12-02 15:59:08 -05:00
Nick Mathewson 64f28a10a5 Clarify DFLT_WEIGHT in weights.rs 2020-12-02 15:48:26 -05:00
Nick Mathewson e931e811b0 Resolve a couple of TODOs in weight.rs
(Thanks to Mike Perry for answers here.)
2020-12-02 15:40:32 -05:00
Nick Mathewson 5dd32ba3c1 weights: refactor a couple of functions to be more testable. 2020-12-02 15:39:12 -05:00
Nick Mathewson 6e755eee4d Use a slightly prettier syntax in max_weight 2020-12-02 15:27:32 -05:00
Nick Mathewson 01de0cafc5 Run cargo fix --edition-idioms 2020-12-02 15:14:29 -05:00
Nick Mathewson aebf1fcc0d Fix a few comments in weight.rs 2020-12-02 14:15:40 -05:00
Nick Mathewson 6f25dd05af Use a better calculation for deciding if we have enough paths. 2020-12-02 14:09:33 -05:00
Nick Mathewson 412f1763de Implement correct (?) weighting for path selection. 2020-12-02 13:51:19 -05:00
Nick Mathewson 4aa61322be Fix a couple of clippy warnings in tor-dirclient. 2020-12-02 13:43:45 -05:00
Nick Mathewson a72437a1c7 Abandon directory circuits on most kinds of directory failure.
(There are more cases that this _doesn't_ handle, but it's a start
for now.)
2020-12-02 09:46:35 -05:00
owen66 c9a202c7ac issue #34: adding support for xz2 2020-12-02 01:20:24 +00:00
Nick Mathewson 85c287c4e4 When retiring circuits, do it by ID, not by reference. 2020-12-01 16:50:51 -05:00
Nick Mathewson 0dc5c7b459 Bump to latest async-io 2020-12-01 15:21:50 -05:00
Nick Mathewson efa6dd708b Expose UniqId types for channels and circuits 2020-12-01 14:00:07 -05:00
Nick Mathewson ea0cb1d2cc Rename LogId -> UniqId. 2020-12-01 13:44:25 -05:00
Nick Mathewson 3fe97baa2a Derive more types for circuit and channel LogIds 2020-12-01 13:21:46 -05:00
Nick Mathewson 31773e0251 Enforce uniqueness on circuit and channel logids 2020-12-01 13:20:41 -05:00
Nick Mathewson db55c84c89 tor-dirmgr: retry up to 3 times on download failure. 2020-12-01 09:38:59 -05: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 85cf6c09b3 Make mmap usage optional. 2020-12-01 07:56:36 -05:00
Nick Mathewson d7b79095c8 tor-dirmgr: tests for storage.rs 2020-12-01 07:44:47 -05:00
Nick Mathewson b0fc36c06a Add a decorrelated-jitter implementation.
This is the algorithm we use on download failure to back off before
we retry.
2020-11-30 16:43:36 -05:00
Nick Mathewson ffd4ed16a0 only expire dorectory info on a successful bootstrap. 2020-11-30 12:54:56 -05:00
Nick Mathewson a1d02d4154 Add tests for blob_fname failing cases 2020-11-30 12:35:33 -05:00
Nick Mathewson 39bc39ddd5 More tests for sqlite.rs 2020-11-30 12:26:11 -05:00
Nick Mathewson c3c3d24973 Initial tests for authcert storage 2020-11-30 11:59:41 -05:00
Nick Mathewson baba0773c3 tor-dirmgr: Refactor storage not to take AuthCert type.
Add a new AuthCertMeta type to make it easier to test.
2020-11-30 11:26:03 -05:00
Nick Mathewson e979bd5cb2 tor-dirmgr: Refactor storage not to take Microdesc type.
Since all it needs is an MDDigest, that's what it should take.  This
will make it easier to test.
2020-11-30 11:11:39 -05:00
Nick Mathewson 1806135313 Add a test for sha3_dual 2020-11-30 11:00:58 -05:00
Nick Mathewson 5f446b238e Add a few more tests for tor-certs. 2020-11-30 09:48:19 -05:00
Nick Mathewson a3a077419a Fix a couple of new clippy warnings. 2020-11-28 14:20:15 -05:00
Nick Mathewson e18b4e07cb Upgrade a couple of dependencies 2020-11-28 14:17:42 -05:00
Nick Mathewson 483fb1f7c4 Implement a maximum length for directory responses 2020-11-25 11:45:00 -05:00
Nick Mathewson 679104a516 Extract another function in tor-dirclient 2020-11-25 11:23:51 -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 3321d72842 Document newer modules 2020-11-25 10:15:32 -05:00
Nick Mathewson ae4e075d5d Update README to mention current state. 2020-11-25 10:01:11 -05:00
Nick Mathewson 0b443665a8 A couple more tests in tor-cert 2020-11-25 09:10:49 -05:00
Nick Mathewson cc55469307 Add a function to retire circuits. 2020-11-24 12:44:04 -05:00