From 051a81febd25f78f79e7609b0f5a7d1ca99a016a Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Sat, 13 Jul 2024 12:48:13 +1200 Subject: [PATCH] Maybe fix the zeroes? --- src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index cb4a364..11b5e5b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -141,7 +141,7 @@ async fn handle_http_request_outer( .or_insert(1); // Get the response, but do not throw error at this point - let response = handle_http_request_inner(peer, request); + let response = handle_http_request_inner(peer, request).await; // Decrement connection counts match GLOBALS.num_connections_per_ip.get_mut(&peer.ip()) { @@ -157,7 +157,7 @@ async fn handle_http_request_outer( let _ = GLOBALS.num_connections.fetch_sub(1, Ordering::SeqCst); // Now we return after the counts have gone up and down - response.await + response } async fn handle_http_request_inner( @@ -220,7 +220,7 @@ async fn handle_http_request_inner( target: "Server", "{}: TOTAL={}, New Connection: {}, {}", peer, - GLOBALS.num_connections.load(Ordering::Relaxed), + GLOBALS.num_connections.load(Ordering::Acquire), origin, ua, ); @@ -289,7 +289,7 @@ async fn handle_http_request_inner( target: "Server", "{}: TOTAL={}, {}, ban={}s", peer, - GLOBALS.num_connections.load(Ordering::Relaxed), + GLOBALS.num_connections.load(Ordering::Acquire), msg, ban_seconds );