1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-28 01:52:57 +01:00

update openssl support

This commit is contained in:
Nikolay Kim 2018-09-26 22:14:14 -07:00
parent 9f1417af30
commit b6a1cfa6ad
3 changed files with 6 additions and 2 deletions

View File

@ -98,6 +98,7 @@ where
}
}
/// This trait indicates types that can create acceptor service for http server.
pub trait AcceptorServiceFactory: Send + Clone + 'static {
type Io: IoStream + Send;
type NewService: NewService<
@ -217,6 +218,7 @@ where
}
#[derive(Clone)]
/// Default acceptor service convert `TcpStream` to a `tokio_tcp::TcpStream`
pub(crate) struct DefaultAcceptor;
impl AcceptorServiceFactory for DefaultAcceptor {

View File

@ -513,9 +513,7 @@ mod tests {
use std::{cmp, io, time};
use bytes::{Buf, Bytes, BytesMut};
use futures::future;
use http::{Method, Version};
use tokio::runtime::current_thread;
use tokio_io::{AsyncRead, AsyncWrite};
use super::*;

View File

@ -268,6 +268,7 @@ where
mut self, lst: net::TcpListener, builder: SslAcceptorBuilder,
) -> io::Result<Self> {
use super::{openssl_acceptor_with_flags, ServerFlags};
use actix_net::service::NewServiceExt;
let flags = if self.no_http2 {
ServerFlags::HTTP1
@ -283,6 +284,7 @@ where
addr,
scheme: "https",
handler: Box::new(HttpServiceBuilder::new(
self.factory.clone(),
move || ssl::OpensslAcceptor::new(acceptor.clone()).map_err(|_| ()),
DefaultPipelineFactory::new(
self.factory.clone(),
@ -411,6 +413,7 @@ where
S: net::ToSocketAddrs,
{
use super::{openssl_acceptor_with_flags, ServerFlags};
use actix_net::service::NewServiceExt;
let sockets = self.bind2(addr)?;
@ -431,6 +434,7 @@ where
addr,
scheme: "https",
handler: Box::new(HttpServiceBuilder::new(
self.factory.clone(),
move || ssl::OpensslAcceptor::new(accpt.clone()).map_err(|_| ()),
DefaultPipelineFactory::new(
self.factory.clone(),