Removed unnecessary protocol declaration.

This commit is contained in:
Ara Sadoyan
2025-03-20 18:40:55 +01:00
parent 5524fd5011
commit cafe18b02e
5 changed files with 8 additions and 22 deletions

View File

@@ -20,7 +20,7 @@ pub async fn hc2(upslist: Arc<UpstreamsDashMap>, fullist: Arc<UpstreamsDashMap>)
let path = path_entry.key();
let mut innervec= Vec::new();
for k in path_entry.value().0.iter().enumerate() {
let (ip, port, ssl, _proto) = k.1;
let (ip, port, ssl) = k.1;
let mut _pref = "";
match ssl {
true => _pref = "https://",

View File

@@ -19,7 +19,6 @@ struct HostConfig {
#[derive(Debug, Serialize, Deserialize)]
struct PathConfig {
protocol: String,
ssl: bool,
servers: Vec<String>,
}
@@ -57,7 +56,7 @@ pub fn load_yaml_to_dashmap(d: &str, kind: &str) -> Option<UpstreamsDashMap> {
for server in path_config.servers {
if let Some((ip, port_str)) = server.split_once(':') {
if let Ok(port) = port_str.parse::<u16>() {
server_list.push((ip.to_string(), port, path_config.ssl, path_config.protocol.clone()));
server_list.push((ip.to_string(), port, path_config.ssl));
}
}
}

View File

@@ -13,14 +13,14 @@ pub fn print_upstreams(upstreams: &UpstreamsDashMap) {
let path = path_entry.key();
println!(" Path: {}", path);
for (ip, port, ssl, proto) in path_entry.value().0.clone() {
println!(" ===> IP: {}, Port: {}, SSL: {}, Proto: {}", ip, port, ssl, proto);
for (ip, port, ssl) in path_entry.value().0.clone() {
println!(" ===> IP: {}, Port: {}, SSL: {}", ip, port, ssl);
}
}
}
}
pub type UpstreamsDashMap = DashMap<String, DashMap<String, (Vec<(String, u16, bool, String)>, AtomicUsize)>>;
pub type UpstreamsDashMap = DashMap<String, DashMap<String, (Vec<(String, u16, bool)>, AtomicUsize)>>;
// pub type UpstreamMap = DashMap<String, (Vec<(String, u16)>, AtomicUsize)>;
#[allow(dead_code)]