mirror of
https://github.com/fafhrd91/actix-net
synced 2025-08-28 02:25:53 +02:00
cleanup ssl services
This commit is contained in:
@@ -8,7 +8,6 @@ use tokio_openssl::{AcceptAsync, SslAcceptorExt, SslStream};
|
||||
|
||||
use crate::counter::{Counter, CounterGuard};
|
||||
use crate::ssl::MAX_CONN_COUNTER;
|
||||
use crate::ServerConfig;
|
||||
|
||||
/// Support `SSL` connections via openssl package
|
||||
///
|
||||
@@ -37,16 +36,14 @@ impl<T: AsyncRead + AsyncWrite> Clone for OpensslAcceptor<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: AsyncRead + AsyncWrite> NewService<T, ServerConfig> for OpensslAcceptor<T> {
|
||||
impl<T: AsyncRead + AsyncWrite> NewService<T> for OpensslAcceptor<T> {
|
||||
type Response = SslStream<T>;
|
||||
type Error = HandshakeError<T>;
|
||||
type Service = OpensslAcceptorService<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(OpensslAcceptorService {
|
||||
acceptor: self.acceptor.clone(),
|
||||
|
Reference in New Issue
Block a user