Use NetDirProvider in GuardMgr
This branch uses the NetDirProvider
API in tor-guardmgr
, so that the GuardMgr
code no longer needs to rely on CircMgr
passing it up-to-date NetDirs
. This change is cosmetic for now, but it will be very helpful for implementing #93 (closed).
A few possible areas to discuss:
- I decided to hand-code the
upcast_arc
implementation in 0e6a5435. I experimented with other approaches, but they both generated a large amount of code that we didn't need, and added a lot of surface-area to this API. See https://gitlab.torproject.org/-/snippets/147 for the alternatives I tried. - The APIs that take an optional
NetDir
argument remain. Removing them would require a rewrite of a fairly big amount of our unit tests, and not really improve the GuardMgr API.
Edited by Nick Mathewson