aquatic http load test: don't stop looping after reading response

It is important to keep reading until EWOULDBLOCK event
This commit is contained in:
Joakim Frostegård 2020-08-03 00:22:22 +02:00
parent e88ecec9c7
commit edeeee8f51
2 changed files with 1 additions and 9 deletions

View file

@ -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,

View file

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