refactor h3 handling

This commit is contained in:
Jun Kurihara 2022-07-18 15:27:27 +09:00
commit f2a341e198
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
4 changed files with 37 additions and 30 deletions

View file

@ -14,10 +14,7 @@ use hyper::{
Body, Client, Request, Response, StatusCode, Uri, Version,
};
use std::{env, net::SocketAddr, sync::Arc};
use tokio::{
io::copy_bidirectional,
time::{timeout, Duration},
};
use tokio::{io::copy_bidirectional, time::timeout};
#[derive(Clone)]
pub struct HttpMessageHandler<T>
@ -129,7 +126,7 @@ where
// Forward request to
let mut res_backend = {
match timeout(
self.globals.upstream_timeout + Duration::from_secs(1),
self.globals.upstream_timeout,
self.forwarder.request(req_forwarded),
)
.await