1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-09-02 00:31:55 +02:00

cleanup ssl services

This commit is contained in:
Nikolay Kim
2019-03-08 22:41:30 -08:00
parent a4d4770462
commit 2099629fe3
3 changed files with 6 additions and 15 deletions

View File

@@ -8,7 +8,6 @@ use tokio_io::{AsyncRead, AsyncWrite};
use crate::counter::{Counter, CounterGuard};
use crate::ssl::MAX_CONN_COUNTER;
use crate::ServerConfig;
/// Support `SSL` connections via native-tls package
///
@@ -37,16 +36,14 @@ impl<T: AsyncRead + AsyncWrite> Clone for NativeTlsAcceptor<T> {
}
}
impl<T: AsyncRead + AsyncWrite> NewService<T, ServerConfig> for NativeTlsAcceptor<T> {
impl<T: AsyncRead + AsyncWrite> NewService<T> for NativeTlsAcceptor<T> {
type Response = TlsStream<T>;
type Error = Error;
type Service = NativeTlsAcceptorService<T>;
type InitError = ();
type Future = FutureResult<Self::Service, Self::InitError>;
fn new_service(&self, cfg: &ServerConfig) -> Self::Future {
cfg.set_secure();
fn new_service(&self, _: &()) -> Self::Future {
MAX_CONN_COUNTER.with(|conns| {
ok(NativeTlsAcceptorService {
acceptor: self.acceptor.clone(),