Commit 80b65c3a authored by Nick Mathewson's avatar Nick Mathewson 🦞
Browse files

Move fallback.rs into guardmgr.

This is the logical place for it, I think: the GuardMgr's job is to
pick the first hop for a circuit depending on remembered status for
possible first hops.  Making this change will let us streamline the
code that interacts with these objects.
parent 5d27710e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3361,6 +3361,7 @@ dependencies = [
 "tor-consdiff",
 "tor-dirclient",
 "tor-error",
 "tor-guardmgr",
 "tor-llcrypto",
 "tor-netdir",
 "tor-netdoc",
+2 −1
Original line number Diff line number Diff line
@@ -51,7 +51,8 @@
#![deny(clippy::unwrap_used)]

use tor_chanmgr::ChanMgr;
use tor_netdir::{fallback::FallbackDir, DirEvent, NetDir, NetDirProvider};
use tor_guardmgr::fallback::FallbackDir;
use tor_netdir::{DirEvent, NetDir, NetDirProvider};
use tor_proto::circuit::{CircParameters, ClientCirc, UniqId};
use tor_rtcompat::Runtime;

+1 −1
Original line number Diff line number Diff line
@@ -1463,7 +1463,7 @@ mod test {

    const FAKE_CIRC_DELAY: Duration = Duration::from_millis(30);

    static DI_EMPTY: [&tor_netdir::fallback::FallbackDir; 0] = [];
    static DI_EMPTY: [&tor_guardmgr::fallback::FallbackDir; 0] = [];

    fn di() -> DirInfo<'static> {
        DI_EMPTY[..].into()
+2 −1
Original line number Diff line number Diff line
@@ -7,8 +7,9 @@ pub mod dirpath;
pub mod exitpath;

use tor_error::bad_api_usage;
use tor_guardmgr::fallback::FallbackDir;
use tor_linkspec::{OwnedChanTarget, OwnedCircTarget};
use tor_netdir::{fallback::FallbackDir, Relay};
use tor_netdir::Relay;

use std::convert::TryFrom;

+1 −1
Original line number Diff line number Diff line
@@ -72,8 +72,8 @@ mod test {
    use crate::path::assert_same_path_when_owned;
    use crate::test::OptDummyGuardMgr;
    use std::collections::HashSet;
    use tor_guardmgr::fallback::FallbackDir;
    use tor_linkspec::ChanTarget;
    use tor_netdir::fallback::FallbackDir;
    use tor_netdir::testnet;

    #[test]
Loading