mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +00:00
aquatic http load test: clean up, minor reformatting
This commit is contained in:
parent
93a7ad0344
commit
e1d8983bb6
1 changed files with 5 additions and 8 deletions
|
|
@ -142,7 +142,7 @@ impl Connection {
|
||||||
let position = request_buffer.position() as usize;
|
let position = request_buffer.position() as usize;
|
||||||
|
|
||||||
match self.send_request_inner(state, &request_buffer.get_mut()[..position]){
|
match self.send_request_inner(state, &request_buffer.get_mut()[..position]){
|
||||||
Ok(_) => {
|
Ok(()) => {
|
||||||
state.statistics.requests.fetch_add(1, Ordering::SeqCst);
|
state.statistics.requests.fetch_add(1, Ordering::SeqCst);
|
||||||
|
|
||||||
self.can_send = false;
|
self.can_send = false;
|
||||||
|
|
@ -224,7 +224,6 @@ pub fn run_socket_thread(
|
||||||
connections.remove(&token.0);
|
connections.remove(&token.0);
|
||||||
num_to_create += 1;
|
num_to_create += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
eprintln!("connection not found: {:?}", token);
|
eprintln!("connection not found: {:?}", token);
|
||||||
}
|
}
|
||||||
|
|
@ -255,17 +254,15 @@ pub fn run_socket_thread(
|
||||||
num_to_create += 1;
|
num_to_create += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
let num_new = num_to_create.min(max_new);
|
for _ in 0..num_to_create.min(max_new){
|
||||||
|
let ok = Connection::create_and_register(
|
||||||
for _ in 0..num_new {
|
|
||||||
let err = Connection::create_and_register(
|
|
||||||
config,
|
config,
|
||||||
&mut connections,
|
&mut connections,
|
||||||
&mut poll,
|
&mut poll,
|
||||||
&mut token_counter,
|
&mut token_counter,
|
||||||
).is_err();
|
).is_ok();
|
||||||
|
|
||||||
if !err {
|
if ok {
|
||||||
num_to_create -= 1;
|
num_to_create -= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue