Make legacy-store code disabled by default.
In the long run we might not want it at all.
This commit is contained in:
parent
2fd2c27ee5
commit
ea27328c67
|
@ -6,6 +6,10 @@ edition = "2018"
|
|||
license = "MIT OR Apache-2.0"
|
||||
publish = false
|
||||
|
||||
[features]
|
||||
default = []
|
||||
legacy-store = []
|
||||
|
||||
[dependencies]
|
||||
tor-chanmgr = { path="../tor-chanmgr", version= "*" }
|
||||
tor-checkable = { path="../tor-checkable", version= "*" }
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
//! Directory configuration tells us where to load and store directory
|
||||
//! information ,where to fetch it from, and how to validate it.
|
||||
|
||||
#[cfg(feature = "legacy-storage")]
|
||||
use crate::storage::legacy::LegacyStore;
|
||||
use crate::storage::sqlite::SqliteStore;
|
||||
use crate::Authority;
|
||||
use crate::PartialNetDir;
|
||||
use crate::{Error, Result};
|
||||
use tor_netdir::fallback::{FallbackDir, FallbackSet};
|
||||
|
||||
|
@ -266,8 +266,9 @@ impl Default for NetDirConfigBuilder {
|
|||
}
|
||||
|
||||
impl NetDirConfig {
|
||||
#[cfg(feature = "legacy-storage")]
|
||||
/// Read directory information from the configured storage location.
|
||||
pub fn load_legacy(&self) -> Result<PartialNetDir> {
|
||||
pub fn load_legacy(&self) -> Result<tor_netdir::PartialNetDir> {
|
||||
let store = LegacyStore::new(self.legacy_cache_path.as_ref().unwrap().clone());
|
||||
store.load_legacy(&self.authorities[..])
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
//! We have code implemented for two methods: the legacy format used by
|
||||
//! the C Tor implementation, and a more flexible format based on sqlite.
|
||||
|
||||
#[cfg(feature = "legacy-storage")]
|
||||
pub(crate) mod legacy;
|
||||
pub(crate) mod sqlite;
|
||||
|
||||
|
|
Loading…
Reference in New Issue