aquatic http load test: remove connection if read 0 bytes

This commit is contained in:
Joakim Frostegård 2020-08-02 21:42:35 +02:00
parent 8d58f8bb70
commit d36f97f272
2 changed files with 8 additions and 0 deletions

View file

@ -53,6 +53,13 @@ impl Connection {
) -> bool { // bool = remove connection
loop {
match self.stream.read(&mut self.read_buffer[self.bytes_read..]){
Ok(0) => {
if self.bytes_read == self.read_buffer.len(){
eprintln!("read buffer is full");
}
break true;
}
Ok(bytes_read) => {
self.bytes_read += bytes_read;