make globals more simple

This commit is contained in:
Jun Kurihara 2023-07-10 18:04:15 +09:00
commit fab28e8609
No known key found for this signature in database
GPG key ID: D992B3E3DE1DED23
6 changed files with 261 additions and 228 deletions

View file

@ -212,21 +212,13 @@ impl Backend {
}
}
#[derive(Default)]
/// HashMap and some meta information for multiple Backend structs.
pub struct Backends {
pub apps: HashMap<ServerNameBytesExp, Backend>, // hyper::uriで抜いたhostで引っ掛ける
pub default_server_name_bytes: Option<ServerNameBytesExp>, // for plaintext http
}
impl Default for Backends {
fn default() -> Self {
Self {
default_server_name_bytes: None,
apps: HashMap::<ServerNameBytesExp, Backend>::default(),
}
}
}
pub type SniServerCryptoMap = HashMap<ServerNameBytesExp, Arc<ServerConfig>>;
pub struct ServerCrypto {
// For Quic/HTTP3, only servers with no client authentication