Commit Graph

547 Commits

Author SHA1 Message Date
Nick Mathewson 8833f7a3a2 Remove one more test println!(). 2021-11-04 11:11:26 -04:00
Nick Mathewson e3f8a9f94f tor-dirmgr: tests for docid module. 2021-11-04 09:47:13 -04:00
Nick Mathewson cdae4c033c Remove some dbg!() calls in real code. 2021-11-02 09:50:55 -04:00
Nick Mathewson e6e740646a Bump all crate versions to 0.0.1 2021-10-29 11:05:51 -04:00
Nick Mathewson c11fe200d1 Try writing a bit more documentation for configuration types. 2021-10-28 20:49:17 -04:00
Nick Mathewson b160177b63 Oops: add missing data files 2021-10-28 19:51:16 -04:00
Nick Mathewson 4a721da54c tor-dirmgr: tests for GetMicrodescsState 2021-10-28 14:21:21 -04:00
Nick Mathewson 2f149621fd tor-dirmgr: tests for download schedules. 2021-10-28 13:08:46 -04:00
Nick Mathewson 7e8891b861 tor-dirmgr: Test for GetCertsState 2021-10-28 10:21:56 -04:00
Nick Mathewson 8956e6cd8b tor-dirmgr: Tests for GetConsensusState.
This test uses a consensus that I've copied from
tor-netdoc/testdata.  I would include it directly, but I think that
will cause trouble when it comes time to run "cargo package".
2021-10-28 09:35:18 -04:00
Nick Mathewson 5e27c46d24 tor-dirmgr::state: Mock the view of current time.
This will let us test the state processing code without having to
give it up-to-date directory objects.
2021-10-28 08:41:59 -04:00
Nick Mathewson 2fae63b5ae Upgrade to fslock version 0.2
This version makes all locks per-handle rather than per-process, by
moving from lockf() to flock() on unix.
2021-10-27 14:52:09 -04:00
Nick Mathewson 968ffa3d6c Migrate tor-dirmgr from chrono to time 0.3
(This appears to be the emerging consensus of how to handle
RUSTSEC-2020-0159.)
2021-10-24 11:12:06 -04:00
Nick Mathewson 730be38867 Replace references to arti-client in the documentation. 2021-10-21 14:22:21 -04:00
Nick Mathewson 6af5700c5d Remove #![allow(unreachable_pub)] in shared_ref.rs 2021-10-21 14:00:38 -04:00
Nick Mathewson f3dc66d964 Merge branch 'share_state' 2021-10-21 13:34:38 -04:00
David Goulet b863e63a21 fallbackdir: Regenerate list for October 2021
Closes #200

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-21 09:18:03 -04:00
Nick Mathewson fdddb74de4 Mark consensus as "not-pending" even if its microdescs come from cache.
Previously our code would clear the 'pending' flag on a consensus
only when a _downloaded_ md made it become usable.

Closes #199.
2021-10-20 14:04:54 -04:00
Nick Mathewson 43506601dc Move tor-dirmgr to use a sync::Mutex.
The futures:🔒:Mutex was unnecessary, since we never held it
when we were suspending.
2021-10-20 13:46:44 -04:00
Nick Mathewson 445ec6d220 Fix most warnings from nightly.
(One represents code that I forgot to write.)
2021-10-19 16:21:12 -04:00
Nick Mathewson 36353aacd8 Fix some typos in comments.
Also, tell the "typos" tool to ignore Cargo.lock.
2021-10-19 10:40:32 -04:00
Nick Mathewson 457e7f064c Reverse two swapped log messages 2021-10-19 10:24:19 -04:00
Nick Mathewson 26e1b6fb72 Improve logging when trying to get the lock on the directory cache.
Previously we'd say that we were "waiting for the other process to
bootstrap" even if it was already bootstrapped: and we wouldn't
actually declare success when it was done.
2021-10-19 10:18:02 -04:00
Jani Monoses f683d4f3cd Remove useless into() conversions caught by clippy. 2021-10-18 13:22:53 +03:00
Jani Monoses 8b8228190d Remove anyhow dependency from tor-dirmgr. 2021-10-18 13:22:53 +03:00
Jani Monoses 6181e623f8 Use unwrap in tests.
For now, this avoids having to separately handle
AuthorityBuilderError, DirMgrConfigBuilderError, DownloadScheduleConfigBuilderError,
NetworkConfigBuilderError and FallbackDirBuilderError when anyhow is not
used.

Turn off a clippy warning.
2021-10-18 13:22:39 +03:00
Nick Mathewson 3b7b43ae5f Turn off default-features in chrono where possible. 2021-10-17 10:37:30 -04:00
Nick Mathewson 02b20edeb3 Add a few tracing directives to tor-dirmgr. 2021-10-13 13:37:18 -04:00
Nick Mathewson e9399ec6c0 tor-dirmgr: report bootstrap success on all successful cases.
Previously we would sometimes fail to report that we had
successfully bootstrapped.
2021-10-13 13:01:55 -04:00
Nick Mathewson 8113a8ba12 Don't report the bootstrap as completed unless it actually succeeds.
(Previously we'd report it as successful even if the inner download
task was a failure.)
2021-10-13 12:19:40 -04:00
Nick Mathewson 33ba697b5d Notify guard manager on network change and state flush. 2021-10-10 12:38:50 -04:00
Nick Mathewson 58da76c6c4 Lock down some dirmgr config functions. 2021-10-09 17:30:06 -04:00
Nick Mathewson 58355d7d54 Re-export configuration types from tor-client. 2021-10-09 17:30:06 -04:00
Nick Mathewson af7c9d5a0b enable checked_conversions lint. 2021-10-09 16:53:13 -04:00
Nick Mathewson 6c6785c04d Fix a type inference complaint in tor-dirmgr's tests.
I have no idea why this just turned up now.
2021-10-07 09:30:08 -04:00
Nick Mathewson 7bdb6e7633 Update cargo.lock; upgrade to newer rusqlite. 2021-10-05 08:10:04 -04:00
Trinity Pointard 954395573a update fslock to compile android 2021-09-25 12:01:45 +02:00
Nick Mathewson b51e2ff5b3 Upgrade memmap2, directories, and dirs dependencies. 2021-09-23 08:26:29 -04:00
Daniel Eades 9a3b183679 remove unused dep 2021-09-19 09:47:57 +01:00
Jani Monoses b0bb7bd100 Do not use set_ prefix on derive_builder setters 2021-09-16 08:41:04 +03:00
Nick Mathewson 0949582fab Use derive_builder for Authority and FallbackDir. 2021-09-10 10:03:33 -04:00
Nick Mathewson 1c97918d67 Typo fixes 2021-09-09 13:06:05 -04:00
Nick Mathewson a00248723d Use derive_builder for the rest of tor_dirmgr::config 2021-09-09 07:38:12 -04:00
Nick Mathewson 372c38e041 Use derive_builder for DownloadScheduleConfig 2021-09-08 17:55:18 -04:00
Nick Mathewson d42d910a4f Use derive_builder for NetworkConfig. 2021-09-08 17:46:00 -04:00
Daniel Eades fb3b8b84b5 fix/silence clippy lints in test modules 2021-09-08 17:28:31 +02:00
Nick Mathewson 557a0ff40b Move all crates into a `crates` subdirectory.
This will cause some pain for now, but now is really the best time
to do this kind of thing.
2021-08-27 09:53:09 -04:00