TlsReloader cleanup

This commit is contained in:
Σrebe - Romain GERARD 2023-12-30 23:38:05 +01:00
parent 5c7bc03e5f
commit ace649a8a1
No known key found for this signature in database
GPG key ID: 7A42B4B97E0332F4
2 changed files with 2 additions and 0 deletions

View file

@ -374,6 +374,7 @@ struct TlsContext<'a> {
tls_config: &'a TlsServerConfig,
}
impl TlsContext<'_> {
#[inline]
pub fn tls_acceptor(&mut self) -> &Arc<TlsAcceptor> {
if self.tls_reloader.should_reload_certificate() {
match tls::tls_acceptor(self.tls_config, Some(vec![b"http/1.1".to_vec()])) {

View file

@ -56,6 +56,7 @@ impl TlsReloader {
Ok(Self { state: Some(this) })
}
#[inline]
pub fn should_reload_certificate(&self) -> bool {
match &self.state {
None => false,