Fix notify progress with TLS

This commit is contained in:
Pascal Engélibert 2026-03-13 10:18:12 +01:00
commit ad2c0909b4

View file

@ -201,6 +201,7 @@ pub async fn play(
let limiter = limiter.clone(); let limiter = limiter.clone();
let running = running.clone(); let running = running.clone();
let dummy_bytes = dummy_bytes.clone(); let dummy_bytes = dummy_bytes.clone();
let notify_socket = notify_socket.clone();
handles.push(tokio::spawn(async move { handles.push(tokio::spawn(async move {
let mut running_guard = running.lock().await; let mut running_guard = running.lock().await;
running_guard.insert(*conn_id); running_guard.insert(*conn_id);
@ -275,6 +276,9 @@ pub async fn play(
println!("Client: {} / {}", cnt + 1, total); println!("Client: {} / {}", cnt + 1, total);
} }
drop(limiter); drop(limiter);
if let Some(notify_socket) = &notify_socket {
notify_socket.send(&cnt.to_be_bytes()).unwrap();
}
let mut running_guard = running.lock().await; let mut running_guard = running.lock().await;
running_guard.remove(conn_id); running_guard.remove(conn_id);
drop(running_guard); drop(running_guard);
@ -361,10 +365,10 @@ pub async fn play(
if debug { if debug {
println!("Client: {} / {}", cnt, total); println!("Client: {} / {}", cnt, total);
} }
drop(limiter);
if let Some(notify_socket) = &notify_socket { if let Some(notify_socket) = &notify_socket {
notify_socket.send(&cnt.to_be_bytes()).unwrap(); notify_socket.send(&cnt.to_be_bytes()).unwrap();
} }
drop(limiter);
let mut running_guard = running.lock().await; let mut running_guard = running.lock().await;
running_guard.remove(conn_id); running_guard.remove(conn_id);
drop(running_guard); drop(running_guard);