Skip to content

Commit

Permalink
chore: deps and refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
junkurihara committed May 9, 2024
1 parent f32e665 commit 305ab44
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions proxy-bin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -17,9 +17,9 @@ publish.workspace = true
[dependencies]
doh-auth-proxy-lib = { path = "../proxy-lib/" }

anyhow = "1.0.82"
anyhow = "1.0.83"
mimalloc = { version = "*", default-features = false }
serde = { version = "1.0.199", default-features = false, features = ["derive"] }
serde = { version = "1.0.201", default-features = false, features = ["derive"] }
derive_builder = "0.20.0"
tokio = { version = "1.37.0", default-features = false, features = [
"net",
14 changes: 7 additions & 7 deletions proxy-bin/src/config/target_config.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use super::{toml::ConfigToml, utils_dns_proto::parse_proto_sockaddr_str, utils_verifier::*};
use crate::{constants::*, error::*, log::*};
use async_trait::async_trait;
use doh_auth_proxy_lib::{
AuthenticationConfig, NextHopRelayConfig, ProxyConfig, QueryManipulationConfig, SubseqRelayConfig,
};
use doh_auth_proxy_lib::{AuthenticationConfig, NextHopRelayConfig, ProxyConfig, QueryManipulationConfig, SubseqRelayConfig};
use hot_reload::{Reload, ReloaderError};
use std::{env, sync::Arc};
use tokio::time::Duration;
@@ -33,8 +31,8 @@ impl Reload<TargetConfig> for ConfigReloader {
}

async fn reload(&self) -> Result<Option<TargetConfig>, ReloaderError<TargetConfig>> {
let config_toml = ConfigToml::new(&self.config_path)
.map_err(|_e| ReloaderError::<TargetConfig>::Reload("Failed to reload config toml"))?;
let config_toml =
ConfigToml::new(&self.config_path).map_err(|_e| ReloaderError::<TargetConfig>::Reload("Failed to reload config toml"))?;
let query_manipulation_config: Option<QueryManipulationConfig> = (&config_toml)
.try_into()
.map_err(|_e| ReloaderError::<TargetConfig>::Reload("Failed to reload manipulation plugin config"))?;
@@ -147,7 +145,7 @@ impl TryInto<ProxyConfig> for &TargetConfig {
/////////////////////////////
// User agent
if let Some(val) = &self.config_toml.user_agent {
proxy_config.http_user_agent = val.clone();
proxy_config.http_user_agent.clone_from(val);
}

/////////////////////////////
@@ -268,7 +266,9 @@ impl TryInto<ProxyConfig> for &TargetConfig {
// Plugins
if self.config_toml.plugins.is_some() {
info!("Query manipulation plugins are enabled");
proxy_config.query_manipulation_config = self.query_manipulation_config.clone();
proxy_config
.query_manipulation_config
.clone_from(&self.query_manipulation_config);
}
////////////////////////

8 changes: 4 additions & 4 deletions proxy-lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -28,11 +28,11 @@ futures = { version = "0.3.30", default-features = false, features = [
"std",
"async-await",
] }
anyhow = "1.0.82"
anyhow = "1.0.83"
tracing = "0.1.40"
thiserror = "1.0.59"
thiserror = "1.0.60"
async-trait = "0.1.80"
serde = { version = "1.0.199", features = ["derive"] }
serde = { version = "1.0.201", features = ["derive"] }
itertools = "0.12.1"
rustc-hash = "1.1.0"

@@ -46,7 +46,7 @@ cedarwood = "0.4.6"
regex = "1.10.4"

# network
socket2 = "0.5.6"
socket2 = "0.5.7"

# http client
reqwest = { version = "0.12.4", default-features = false, features = [
2 changes: 1 addition & 1 deletion proxy-lib/src/bootstrap.rs
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@ impl std::fmt::Display for BootstrapDnsInner {
}

impl BootstrapDnsInner {
///
/// Generate a new BootstrapDnsInner
pub(crate) fn try_new(proto: &str, addr: &str) -> Result<Self> {
Ok(Self {
proto: <BootstrapDnsProto as std::str::FromStr>::from_str(proto)?,

0 comments on commit 305ab44

Please sign in to comment.