Commit Graph

514 Commits

Author SHA1 Message Date
Nick Mathewson 73669fa05e Make the guard selection function return a more useful type. 2021-10-11 15:23:12 -04:00
Nick Mathewson 91cca2183e Change the GuardMgr APIs to no longer be async. 2021-10-10 12:14:33 -04:00
Nick Mathewson 34c10feae4 Use an mpsc::unbounded() channel in GuardMgr.
The advantage here is that we no longer have to use a futures-aware
Mutex, or a blocking send operation, and therefore can simplify a
bunch of the GuardMgr APIs to no longer be async.  That'll avoid
having to propagate the asyncness up the stack.

The disadvantage is that unbounded channels are just that: nothing
in the channel prevents us from overfilling it.  Fortunately, the
process that consumes from the channel shouldn't block much, and
the channel only gets filled when we're planning a circuit path.
2021-10-10 12:08:31 -04:00
Nick Mathewson af7c9d5a0b enable checked_conversions lint. 2021-10-09 16:53:13 -04:00
Nick Mathewson 2fa6f5dbb0 Normalize tor-guardmgr warnings 2021-10-09 16:17:54 -04:00
Nick Mathewson a0bcec5863 Note a possible heisenbug in a unit test. 2021-10-08 10:03:38 -04:00
Nick Mathewson aed9572c03 Add a few tracing calls to tor-guardmgr. 2021-10-08 09:14:36 -04:00
Nick Mathewson 29112e0729 Update the tor-guardmgr README.md. 2021-10-07 15:36:26 -04:00
Nick Mathewson 0ff56a3138 Resolve small issues and XXXX/TODO comments in GuardMgr.
By the time I merge this, most of the comments should have tickets
to go with them.
2021-10-07 14:03:21 -04:00
Nick Mathewson 00acc5c5b8 Tests for top-level GuardMgr.
Also, refactor our message handling to be more like the tor_proto
reactors.  The previous code had a bug where, once the stream of
events was exhausted, we wouldn't actually get any more
notifications.
2021-10-07 12:09:29 -04:00
Nick Mathewson 7ef33b7afa Tests for tor_guardmgr::sample. 2021-10-07 10:45:42 -04:00
Nick Mathewson 0710fb2102 Initial tests for tor_guardmgr::guard 2021-10-07 10:45:42 -04:00
Nick Mathewson 6cdce3dee6 Implement persistent state for guard mgr 2021-10-07 10:45:42 -04:00
Nick Mathewson 0779923d64 Initial backend implementation for guard node manager.
There are some missing parts here (like persistence and tests)
and some incorrect parts (I am 90% sure that the "exploratory
circuit" flag is bogus).  Also it is not integrated with the circuit
manager code.
2021-10-07 10:45:42 -04:00