mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-25 14:49:20 +02:00
update actix-server dep
This commit is contained in:
@ -2,6 +2,7 @@ use std::io::{Read, Write};
|
||||
use std::time::Duration;
|
||||
use std::{net, thread};
|
||||
|
||||
use actix_codec::{AsyncRead, AsyncWrite};
|
||||
use actix_http_test::TestServer;
|
||||
use actix_server_config::ServerConfig;
|
||||
use actix_service::{fn_cfg_factory, NewService};
|
||||
@ -50,7 +51,8 @@ fn test_h1_2() {
|
||||
}
|
||||
|
||||
#[cfg(feature = "ssl")]
|
||||
fn ssl_acceptor<T>() -> std::io::Result<actix_server::ssl::OpensslAcceptor<T, ()>> {
|
||||
fn ssl_acceptor<T: AsyncRead + AsyncWrite>(
|
||||
) -> std::io::Result<actix_server::ssl::OpensslAcceptor<T, ()>> {
|
||||
use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod};
|
||||
// load ssl keys
|
||||
let mut builder = SslAcceptor::mozilla_intermediate(SslMethod::tls()).unwrap();
|
||||
|
@ -9,6 +9,7 @@ use actix_utils::stream::TakeItem;
|
||||
use bytes::{Bytes, BytesMut};
|
||||
use futures::future::{ok, Either};
|
||||
use futures::{Future, Sink, Stream};
|
||||
use tokio_tcp::TcpStream;
|
||||
|
||||
use actix_http::{h1, ws, ResponseError, SendResponse, ServiceConfig};
|
||||
|
||||
@ -36,7 +37,7 @@ fn ws_service(req: ws::Frame) -> impl Future<Item = ws::Message, Error = io::Err
|
||||
#[test]
|
||||
fn test_simple() {
|
||||
let mut srv = TestServer::new(|| {
|
||||
fn_service(|io: Io<_>| Ok(io.into_parts().0))
|
||||
fn_service(|io: Io<TcpStream>| Ok(io.into_parts().0))
|
||||
.and_then(IntoFramed::new(|| h1::Codec::new(ServiceConfig::default())))
|
||||
.and_then(TakeItem::new().map_err(|_| ()))
|
||||
.and_then(|(req, framed): (_, Framed<_, _>)| {
|
||||
|
Reference in New Issue
Block a user