1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-30 03:50:42 +00:00

upgrade rustls

This commit is contained in:
Nikolay Kim 2018-10-02 13:37:30 -07:00
parent fc7c436387
commit 70efa00646
2 changed files with 7 additions and 7 deletions

View file

@ -67,8 +67,8 @@ openssl = { version="0.10", optional = true }
tokio-openssl = { version="0.2", optional = true }
#rustls
rustls = { version = "^0.13.1", optional = true }
tokio-rustls = { version = "^0.7.2", optional = true }
rustls = { version = "^0.14", optional = true }
tokio-rustls = { version = "^0.8", optional = true }
webpki = { version = "0.18", optional = true }
webpki-roots = { version = "0.15", optional = true }

View file

@ -5,7 +5,7 @@ use std::sync::Arc;
use futures::{future::ok, future::FutureResult, Async, Future, Poll};
use rustls::{ServerConfig, ServerSession};
use tokio_io::{AsyncRead, AsyncWrite};
use tokio_rustls::{AcceptAsync, ServerConfigExt, TlsStream};
use tokio_rustls::{Accept, TlsAcceptor, TlsStream};
use super::MAX_CONN_COUNTER;
use counter::{Counter, CounterGuard};
@ -49,7 +49,7 @@ impl<T: AsyncRead + AsyncWrite> NewService for RustlsAcceptor<T> {
fn new_service(&self) -> Self::Future {
MAX_CONN_COUNTER.with(|conns| {
ok(RustlsAcceptorService {
config: self.config.clone(),
acceptor: self.config.clone().into(),
conns: conns.clone(),
io: PhantomData,
})
@ -58,7 +58,7 @@ impl<T: AsyncRead + AsyncWrite> NewService for RustlsAcceptor<T> {
}
pub struct RustlsAcceptorService<T> {
config: Arc<ServerConfig>,
acceptor: TlsAcceptor,
io: PhantomData<T>,
conns: Counter,
}
@ -80,7 +80,7 @@ impl<T: AsyncRead + AsyncWrite> Service for RustlsAcceptorService<T> {
fn call(&mut self, req: Self::Request) -> Self::Future {
RustlsAcceptorServiceFut {
_guard: self.conns.get(),
fut: ServerConfigExt::accept_async(&self.config, req),
fut: self.acceptor.accept(req),
}
}
}
@ -89,7 +89,7 @@ pub struct RustlsAcceptorServiceFut<T>
where
T: AsyncRead + AsyncWrite,
{
fut: AcceptAsync<T>,
fut: Accept<T>,
_guard: CounterGuard,
}