Construct NetDir with geoip support
View options
- Truncate descriptions
I wanted to get the country codes from Relay
, but noticed that they're never set. tor-netdir
has a geoip
feature that gives PartialNetDir
a new_with_geoip
method. This method is never called currently.
Changes needed to use PartialNetDir::new_with_geoip
:
- add
geoip
feature toarti_client
. This is not strictly needed, but is how I imagine one enables geoip support in general. - add
geoip
feature and optional dependency ontor-geoip
totor-dirmgr
. - add
geoip_db: Arc<GeoipDb>
toDirMgr
. - in
DirMgr::from_config
: getGeoipDb::from_embedded
and put it intoDirMgr
. We could also pass in theGeoipDb
from further up the graph. I'm not sure about this. - add
geoip_db
field toGetConsensusState
and add it to the constructor. - add
geoip_db
toGetCertsState
- add
geoip_db
toGetMicrodescsState
. This is needed forGetMicrodescsState::reset
. - pass
geoip_db
toGetMicrodescsState::new
- this is the call-site of
PartialNetDir::new_with_geoip
- adding an argument here triggers clippy's warning that the method has to many arguments.
- this is the call-site of
I have working code (only clippy fails) here
So my main questions are:
-
How do we make clippy happy with the method with too many arguments. Note that 2 arguments in that signature are behind a feature flag.
-
Should we pass the
GeoipDb
to the dirmgr from further up. If so, how? -
Should we pass
Option<Arc<GeoipDb>>
instead (so it can be disabled at runtime).
- Show labels
- Show closed items