bugfix: fix missed client_cache_size config item in SSLocalExtConfig (#1319)

This commit is contained in:
Hanwei Jin
2023-10-08 23:52:13 +08:00
committed by GitHub
parent ea7346c576
commit b25e9e36af
2 changed files with 12 additions and 0 deletions

View File

@@ -597,6 +597,8 @@ Example configuration:
"remote_dns_address": "8.8.8.8",
// OPTIONAL. Remote DNS's port, 53 by default
"remote_dns_port": 53,
// OPTIONAL. dns client cache size for fetching dns queries.
"client_cache_size": 5
},
{
// Tun local server (feature = "local-tun")

View File

@@ -260,6 +260,9 @@ struct SSLocalExtConfig {
#[cfg(feature = "local-dns")]
#[serde(skip_serializing_if = "Option::is_none")]
remote_dns_port: Option<u16>,
#[cfg(feature = "local-dns")]
#[serde(skip_serializing_if = "Option::is_none")]
client_cache_size: Option<usize>,
/// Tunnel
#[cfg(feature = "local-tunnel")]
@@ -1537,6 +1540,11 @@ impl Config {
}
}
#[cfg(feature = "local-dns")]
if let Some(client_cache_size) = local.client_cache_size {
local_config.client_cache_size = Some(client_cache_size);
}
#[cfg(feature = "local-dns")]
if let Some(remote_dns_address) = local.remote_dns_address {
let remote_dns_port = local.remote_dns_port.unwrap_or(53);
@@ -2457,6 +2465,8 @@ impl fmt::Display for Config {
Address::DomainNameAddress(.., port) => Some(*port),
},
},
#[cfg(feature = "local-dns")]
client_cache_size: local.client_cache_size,
#[cfg(feature = "local-tun")]
tun_interface_name: local.tun_interface_name.clone(),
#[cfg(feature = "local-tun")]