mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic http load test: add option for closing conn after response
This commit is contained in:
parent
f9d85117b1
commit
8a3f3fa330
2 changed files with 8 additions and 2 deletions
|
|
@ -48,6 +48,7 @@ impl Connection {
|
|||
|
||||
pub fn read_response(
|
||||
&mut self,
|
||||
config: &Config,
|
||||
state: &LoadTestState,
|
||||
) -> bool { // bool = remove connection
|
||||
loop {
|
||||
|
|
@ -93,7 +94,7 @@ impl Connection {
|
|||
self.bytes_read = 0;
|
||||
self.can_send = true;
|
||||
|
||||
break false;
|
||||
break config.network.close_connection_after_response;
|
||||
},
|
||||
Err(err) => {
|
||||
eprintln!(
|
||||
|
|
@ -218,7 +219,10 @@ pub fn run_socket_thread(
|
|||
let token = event.token();
|
||||
|
||||
if let Some(connection) = connections.get_mut(&token.0){
|
||||
let remove_connection = connection.read_response(&state);
|
||||
let remove_connection = connection.read_response(
|
||||
config,
|
||||
&state
|
||||
);
|
||||
|
||||
if remove_connection {
|
||||
connections.remove(&token.0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue