add unstable build for testing
This commit is contained in:
parent
1c1b50d213
commit
78a5487293
4 changed files with 36 additions and 10 deletions
|
|
@ -1,5 +1,6 @@
|
|||
use super::proxy_main::Proxy;
|
||||
use crate::{
|
||||
constants::CONNECTION_TIMEOUT_SEC,
|
||||
crypto::CryptoSource,
|
||||
error::*,
|
||||
hyper_ext::body::{IncomingLike, RequestBody},
|
||||
|
|
@ -10,7 +11,7 @@ use bytes::{Buf, Bytes};
|
|||
use http::{Request, Response};
|
||||
use http_body_util::BodyExt;
|
||||
use hyper_util::client::legacy::connect::Connect;
|
||||
use std::net::SocketAddr;
|
||||
use std::{net::SocketAddr, time::Duration};
|
||||
|
||||
#[cfg(feature = "http3-quinn")]
|
||||
use h3::{quic::BidiStream, quic::Connection as ConnectionQuic, server::RequestStream};
|
||||
|
|
@ -70,9 +71,11 @@ where
|
|||
let self_inner = self.clone();
|
||||
let tls_server_name_inner = tls_server_name.clone();
|
||||
self.globals.runtime_handle.spawn(async move {
|
||||
if let Err(e) = self_inner
|
||||
.h3_serve_stream(req, stream, client_addr, tls_server_name_inner)
|
||||
.await
|
||||
if let Err(e) = tokio::time::timeout(
|
||||
Duration::from_secs(CONNECTION_TIMEOUT_SEC + 1), // just in case...
|
||||
self_inner.h3_serve_stream(req, stream, client_addr, tls_server_name_inner),
|
||||
)
|
||||
.await
|
||||
{
|
||||
warn!("HTTP/3 error on serve stream: {}", e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use super::socket::bind_tcp_socket;
|
||||
use crate::{
|
||||
constants::TLS_HANDSHAKE_TIMEOUT_SEC,
|
||||
constants::{CONNECTION_TIMEOUT_SEC, TLS_HANDSHAKE_TIMEOUT_SEC},
|
||||
crypto::{CryptoSource, ServerCrypto, SniServerCryptoMap},
|
||||
error::*,
|
||||
globals::Globals,
|
||||
|
|
@ -88,9 +88,11 @@ where
|
|||
let message_handler_clone = self.message_handler.clone();
|
||||
let tls_enabled = self.tls_enabled;
|
||||
let listening_on = self.listening_on;
|
||||
let timeout_sec = Duration::from_secs(CONNECTION_TIMEOUT_SEC + 1); // just in case...
|
||||
self.globals.runtime_handle.clone().spawn(async move {
|
||||
server_clone
|
||||
.serve_connection_with_upgrades(
|
||||
timeout(
|
||||
timeout_sec + Duration::from_secs(1), // just in case...
|
||||
server_clone.serve_connection_with_upgrades(
|
||||
stream,
|
||||
service_fn(move |req: Request<Incoming>| {
|
||||
serve_request(
|
||||
|
|
@ -102,9 +104,10 @@ where
|
|||
tls_server_name.clone(),
|
||||
)
|
||||
}),
|
||||
)
|
||||
.await
|
||||
.ok();
|
||||
),
|
||||
)
|
||||
.await
|
||||
.ok();
|
||||
|
||||
request_count.decrement();
|
||||
debug!("Request processed: current # {}", request_count.current());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue