add unstable build for testing

This commit is contained in:
Jun Kurihara 2023-12-15 16:50:49 +09:00
commit 78a5487293
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
4 changed files with 36 additions and 10 deletions

View file

@ -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());