Commit 837c7d71 authored by Nick Mathewson's avatar Nick Mathewson 🦀
Browse files

Follow-up from !318

Make update_config only conditionally exported; add semver-status update.
parent d95dce7c
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ impl DirMgrConfig {
    /// `self` are replaced with those from  `new_config`.
    ///
    /// Any fields which aren't allowed to change at runtime are copied from self.
    pub fn update_config(&self, new_config: &DirMgrConfig) -> DirMgrConfig {
    pub(crate) fn update_from_config(&self, new_config: &DirMgrConfig) -> DirMgrConfig {
        DirMgrConfig {
            cache_path: self.cache_path.clone(),
            network_config: NetworkConfig {
@@ -278,6 +278,15 @@ impl DirMgrConfig {
            override_net_params: new_config.override_net_params.clone(),
        }
    }

    /// Construct a new configuration object where all replaceable fields in
    /// `self` are replaced with those from  `new_config`.
    ///
    /// Any fields which aren't allowed to change at runtime are copied from self.
    #[cfg(feature = "experimental-api")]
    pub fn update_config(&self, new_config: &DirMgrConfig) -> DirMgrConfig {
        self.update_from_config(new_config)
    }
}

impl DownloadScheduleConfig {
+1 −1
Original line number Diff line number Diff line
@@ -620,7 +620,7 @@ impl<R: Runtime> DirMgr<R> {
        let params_changed = new_config.override_net_params() != config.override_net_params();

        self.config
            .map_and_replace(|cfg| cfg.update_config(new_config));
            .map_and_replace(|cfg| cfg.update_from_config(new_config));

        if params_changed {
            let _ignore_err = self.netdir.mutate(|netdir| {
+9 −0
Original line number Diff line number Diff line
@@ -35,4 +35,13 @@ arti-client:
  api-break (experimental only): changed circmgr() and dirmgr() to return
  &Arc, not Arc.

tor-dirmgr:

  new-api: DirMgrConfig object now has accessors.

tor-netdoc:

  new-api (experimental only): Can modify the set of relays in an unverified
  consensus.