mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-02-09 01:59:16 +08:00
bugfix: fix missed client_cache_size config item in SSLocalExtConfig (#1319)
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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")]
|
||||
|
||||
Reference in New Issue
Block a user