From edeeee8f51af6a464e21462c29e261f5ee178c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Mon, 3 Aug 2020 00:22:22 +0200 Subject: [PATCH] aquatic http load test: don't stop looping after reading response It is important to keep reading until EWOULDBLOCK event --- aquatic_http_load_test/src/config.rs | 2 -- aquatic_http_load_test/src/network.rs | 8 +------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/aquatic_http_load_test/src/config.rs b/aquatic_http_load_test/src/config.rs index 899f8bd..894d232 100644 --- a/aquatic_http_load_test/src/config.rs +++ b/aquatic_http_load_test/src/config.rs @@ -21,7 +21,6 @@ impl aquatic_cli_helpers::Config for Config {} #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(default)] pub struct NetworkConfig { - pub close_connection_after_response: bool, pub connection_creation_interval: usize, pub poll_timeout_microseconds: u64, pub poll_event_capacity: usize, @@ -63,7 +62,6 @@ impl Default for Config { impl Default for NetworkConfig { fn default() -> Self { Self { - close_connection_after_response: false, connection_creation_interval: 10, poll_timeout_microseconds: 197, poll_event_capacity: 64, diff --git a/aquatic_http_load_test/src/network.rs b/aquatic_http_load_test/src/network.rs index 65e5335..b294120 100644 --- a/aquatic_http_load_test/src/network.rs +++ b/aquatic_http_load_test/src/network.rs @@ -48,7 +48,6 @@ impl Connection { pub fn read_response( &mut self, - config: &Config, state: &LoadTestState, ) -> bool { // bool = remove connection loop { @@ -100,8 +99,6 @@ impl Connection { self.bytes_read = 0; self.can_send = true; - - break config.network.close_connection_after_response; }, Err(err) => { eprintln!( @@ -226,10 +223,7 @@ pub fn run_socket_thread( let token = event.token(); if let Some(connection) = connections.get_mut(&token.0){ - let remove_connection = connection.read_response( - config, - &state - ); + let remove_connection = connection.read_response(&state); if remove_connection { connections.remove(&token.0);