refactor: make some config parameters in globals belong to other struct

This commit is contained in:
Jun Kurihara 2023-07-07 21:54:56 +09:00
commit f8d37f7846
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
8 changed files with 109 additions and 101 deletions

View file

@ -218,6 +218,15 @@ pub struct Backends {
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