Loading crates/tor-circmgr/src/lib.rs +3 −3 Original line number Diff line number Diff line Loading @@ -105,13 +105,13 @@ const PARETO_TIMEOUT_DATA_KEY: &str = "circuit_timeouts"; #[non_exhaustive] pub enum DirInfo<'a> { /// A list of fallbacks, for use when we don't know a network directory. Fallbacks(&'a [FallbackDir]), Fallbacks(&'a [&'a FallbackDir]), /// A complete network directory Directory(&'a NetDir), } impl<'a> From<&'a [FallbackDir]> for DirInfo<'a> { fn from(v: &'a [FallbackDir]) -> DirInfo<'a> { impl<'a> From<&'a [&'a FallbackDir]> for DirInfo<'a> { fn from(v: &'a [&'a FallbackDir]) -> DirInfo<'a> { DirInfo::Fallbacks(v) } } Loading crates/tor-circmgr/src/mgr.rs +1 −1 Original line number Diff line number Diff line Loading @@ -1460,7 +1460,7 @@ mod test { const FAKE_CIRC_DELAY: Duration = Duration::from_millis(30); static DI_EMPTY: [tor_netdir::fallback::FallbackDir; 0] = []; static DI_EMPTY: [&tor_netdir::fallback::FallbackDir; 0] = []; fn di() -> DirInfo<'static> { DI_EMPTY[..].into() Loading crates/tor-circmgr/src/path/dirpath.rs +3 −2 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ mod test { #[test] fn dirpath_fallback() { let fb = vec![ let fb_owned = vec![ FallbackDir::builder() .rsa_identity([0x01; 20].into()) .ed_identity([0x01; 32].into()) Loading @@ -116,6 +116,7 @@ mod test { .build() .unwrap(), ]; let fb: Vec<_> = fb_owned.iter().collect(); let dirinfo = (&fb[..]).into(); let mut rng = rand::thread_rng(); let guards: OptDummyGuardMgr<'_> = None; Loading @@ -128,7 +129,7 @@ mod test { assert_same_path_when_owned(&p); if let crate::path::TorPathInner::FallbackOneHop(f) = p.inner { assert!(std::ptr::eq(f, &fb[0]) || std::ptr::eq(f, &fb[1])); assert!(std::ptr::eq(f, fb[0]) || std::ptr::eq(f, fb[1])); } else { panic!("Generated the wrong kind of path."); } Loading crates/tor-dirmgr/src/bootstrap.rs +5 −1 Original line number Diff line number Diff line Loading @@ -59,9 +59,13 @@ async fn fetch_single<R: Runtime>( let circmgr = dirmgr.circmgr()?; let cur_netdir = dirmgr.opt_netdir(); let config = dirmgr.config.get(); let fbs; let dirinfo = match cur_netdir { Some(ref netdir) => netdir.as_ref().into(), None => config.fallbacks().into(), None => { fbs = config.fallbacks().iter().collect::<Vec<_>>(); fbs[..].into() } }; let resource = tor_dirclient::get_resource(request.as_requestable(), dirinfo, &dirmgr.runtime, circmgr) Loading doc/semver_status.md +5 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,11 @@ arti-client: api-break: isolation completely revised tor-circmgr: api-break: The fallbacks case of DirInfo now wants a slice of references to fallbacks. tor-dirmgr: new-api: DirMgrConfig object now has accessors. DirMgrCfg: totally changed, builder abolished. Loading Loading
crates/tor-circmgr/src/lib.rs +3 −3 Original line number Diff line number Diff line Loading @@ -105,13 +105,13 @@ const PARETO_TIMEOUT_DATA_KEY: &str = "circuit_timeouts"; #[non_exhaustive] pub enum DirInfo<'a> { /// A list of fallbacks, for use when we don't know a network directory. Fallbacks(&'a [FallbackDir]), Fallbacks(&'a [&'a FallbackDir]), /// A complete network directory Directory(&'a NetDir), } impl<'a> From<&'a [FallbackDir]> for DirInfo<'a> { fn from(v: &'a [FallbackDir]) -> DirInfo<'a> { impl<'a> From<&'a [&'a FallbackDir]> for DirInfo<'a> { fn from(v: &'a [&'a FallbackDir]) -> DirInfo<'a> { DirInfo::Fallbacks(v) } } Loading
crates/tor-circmgr/src/mgr.rs +1 −1 Original line number Diff line number Diff line Loading @@ -1460,7 +1460,7 @@ mod test { const FAKE_CIRC_DELAY: Duration = Duration::from_millis(30); static DI_EMPTY: [tor_netdir::fallback::FallbackDir; 0] = []; static DI_EMPTY: [&tor_netdir::fallback::FallbackDir; 0] = []; fn di() -> DirInfo<'static> { DI_EMPTY[..].into() Loading
crates/tor-circmgr/src/path/dirpath.rs +3 −2 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ mod test { #[test] fn dirpath_fallback() { let fb = vec![ let fb_owned = vec![ FallbackDir::builder() .rsa_identity([0x01; 20].into()) .ed_identity([0x01; 32].into()) Loading @@ -116,6 +116,7 @@ mod test { .build() .unwrap(), ]; let fb: Vec<_> = fb_owned.iter().collect(); let dirinfo = (&fb[..]).into(); let mut rng = rand::thread_rng(); let guards: OptDummyGuardMgr<'_> = None; Loading @@ -128,7 +129,7 @@ mod test { assert_same_path_when_owned(&p); if let crate::path::TorPathInner::FallbackOneHop(f) = p.inner { assert!(std::ptr::eq(f, &fb[0]) || std::ptr::eq(f, &fb[1])); assert!(std::ptr::eq(f, fb[0]) || std::ptr::eq(f, fb[1])); } else { panic!("Generated the wrong kind of path."); } Loading
crates/tor-dirmgr/src/bootstrap.rs +5 −1 Original line number Diff line number Diff line Loading @@ -59,9 +59,13 @@ async fn fetch_single<R: Runtime>( let circmgr = dirmgr.circmgr()?; let cur_netdir = dirmgr.opt_netdir(); let config = dirmgr.config.get(); let fbs; let dirinfo = match cur_netdir { Some(ref netdir) => netdir.as_ref().into(), None => config.fallbacks().into(), None => { fbs = config.fallbacks().iter().collect::<Vec<_>>(); fbs[..].into() } }; let resource = tor_dirclient::get_resource(request.as_requestable(), dirinfo, &dirmgr.runtime, circmgr) Loading
doc/semver_status.md +5 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,11 @@ arti-client: api-break: isolation completely revised tor-circmgr: api-break: The fallbacks case of DirInfo now wants a slice of references to fallbacks. tor-dirmgr: new-api: DirMgrConfig object now has accessors. DirMgrCfg: totally changed, builder abolished. Loading