// TODO(trezm): Add an argument here for the tls_acceptor to be passed in.
Add an argument here for the tls_acceptor to be passed in.
Add an argument here for the tls_acceptor to be passed in .
fn process<T: Context<Response = Response> + Send>(app: Arc<App<Request, T>>, tls_acceptor: Arc<tokio_tls::TlsAcceptor>, socket: TcpStream) {
      let tls_accept = tls_acceptor
        .accept(socket)
        .and_then(move |tls| {
          let framed = Framed::new(tls, Http);
          let (tx, rx) = framed.split();
          let task = tx.send_all(rx.and_then(move |request: Request| {
                let matched = app.resolve_from_method_and_path(request.method(), request.path());
                app.resolve(request, matched)
              }))
              .then(|_| {
                future::ok(())
              });
          tokio::spawn(task);
          Ok(())
        })
        .map_err(|err| {
          println!("TLS accept error: {:?}", err);
        });
      tokio::spawn(tls_accept);
    }
fn process < T : Context < Response = Response > + Send > ( app : Arc < App < Request , T > > , tls_acceptor : Arc < tokio_tls :: TlsAcceptor > , socket : TcpStream ) { let tls_accept = tls_acceptor . accept ( socket ) . and_then ( move | tls | { let framed = Framed :: new ( tls , Http ) ; let ( tx , rx ) = framed . split ( ) ; let task = tx . send_all ( rx . and_then ( move | request : Request | { let matched = app . resolve_from_method_and_path ( request . method ( ) , request . path ( ) ) ; app . resolve ( request , matched ) } ) ) . then ( | _ | { future :: ok ( ( ) ) } ) ; tokio :: spawn ( task ) ; Ok ( ( ) ) } ) . map_err ( | err | { println ! ( " " err ) ; } ) ; tokio :: spawn ( tls_accept ) ; }
TODO(trezm): Add an argument here for the tls_acceptor to be passed in.
TODO ( trezm ) : Add an argument here for the tls_acceptor to be passed in .
app
Arc<App<Request, T>>
tls_acceptor
Arc<tokio_tls::TlsAcceptor>
socket
TcpStream