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

@ -9,6 +9,7 @@
* opening new connections in current form causes macOS issues, why?
* try creating sockets with different ports (and also local ips if setting
enabled), then converting them to mio tcp streams
* really break and remove connection when reading 0 bytes?
* find out how to fully load opentracker
* only half the number of requests are sent back as responses in opentracker
and in aquatic when keep_alive is set to false, why?

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;