fix upgrade for http1.1 and 2

This commit is contained in:
Jun Kurihara 2022-07-06 14:13:55 +09:00
commit 6d5c904f12
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03

View file

@ -61,10 +61,12 @@ where
self.globals.runtime_handle.clone().spawn(async move { self.globals.runtime_handle.clone().spawn(async move {
tokio::time::timeout( tokio::time::timeout(
self.globals.timeout + Duration::from_secs(1), self.globals.timeout + Duration::from_secs(1),
server.serve_connection( server
stream, .serve_connection(
service_fn(move |req: Request<Body>| self.clone().handle_request(req, peer_addr)), stream,
), service_fn(move |req: Request<Body>| self.clone().handle_request(req, peer_addr)),
)
.with_upgrades(),
) )
.await .await
.ok(); .ok();