From ce1019d4706229086834e7439c904a6dc09f385b Mon Sep 17 00:00:00 2001 From: hatoo Date: Sun, 5 May 2024 22:55:54 +0900 Subject: [PATCH] fix --- src/client.rs | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/client.rs b/src/client.rs index 5a3614ac..71bec7f8 100644 --- a/src/client.rs +++ b/src/client.rs @@ -799,34 +799,6 @@ async fn work_http2_once( (is_cancel, is_reconnect) } -async fn work_http2_or_acquire( - client: &Client, - client_state: &mut ClientStateHttp2, - report_tx: &flume::Sender>, - connection_time: ConnectionTime, - start_latency_correction: Option, - semaphore: &tokio::sync::Semaphore, -) -> (bool, bool) { - tokio::select! { - mut res = - client.work_http2(client_state) => { - let is_cancel = is_cancel_error(&res); - let is_reconnect = is_hyper_error(&res); - set_connection_time(&mut res, connection_time); - if let Some(start_latency_correction) = start_latency_correction { - set_start_latency_correction(&mut res, start_latency_correction); - } - report_tx.send_async(res).await.unwrap(); - (is_cancel ,is_reconnect ) - - } - _ = semaphore.acquire() => { - report_tx.send_async(Err(ClientError::Deadline)).await.unwrap(); - (true, false) - } - } -} - fn set_connection_time(res: &mut Result, connection_time: ConnectionTime) { if let Ok(res) = res { res.connection_time = Some(connection_time); @@ -1640,13 +1612,12 @@ pub async fn work_until_with_qps_latency_correction( is_cancel = async { while let Ok(start) = rx.recv_async().await { let (is_cancel, is_reconnect) = - work_http2_or_acquire( + work_http2_once( &client, &mut client_state, &report_tx, connection_time, Some(start), - &s, ) .await; if is_cancel || is_reconnect {