mirror of
https://github.com/fafhrd91/actix-net
synced 2025-06-28 06:20:36 +02:00
add Debug impl for Io; update examples
This commit is contained in:
@ -9,7 +9,7 @@ use std::{env, fmt, io};
|
||||
|
||||
use actix_codec::{AsyncRead, AsyncWrite};
|
||||
use actix_rt::System;
|
||||
use actix_server::Server;
|
||||
use actix_server::{Io, Server};
|
||||
use actix_service::{fn_service, NewService};
|
||||
use futures::{future, Future};
|
||||
use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod};
|
||||
@ -54,8 +54,8 @@ fn main() -> io::Result<()> {
|
||||
let acceptor = acceptor.clone();
|
||||
|
||||
// service for converting incoming TcpStream to a SslStream<TcpStream>
|
||||
fn_service(move |stream: tokio_tcp::TcpStream| {
|
||||
SslAcceptorExt::accept_async(&acceptor, stream)
|
||||
fn_service(move |stream: Io<tokio_tcp::TcpStream>| {
|
||||
SslAcceptorExt::accept_async(&acceptor, stream.into_parts().0)
|
||||
.map_err(|e| println!("Openssl error: {}", e))
|
||||
})
|
||||
// .and_then() combinator uses other service to convert incoming `Request` to a
|
||||
|
Reference in New Issue
Block a user