mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
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:
parent
e88ecec9c7
commit
edeeee8f51
2 changed files with 1 additions and 9 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue