From d36f97f2722f67803215bd80f4b1bdcd36bb9b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sun, 2 Aug 2020 21:42:35 +0200 Subject: [PATCH] aquatic http load test: remove connection if read 0 bytes --- TODO.md | 1 + aquatic_http_load_test/src/network.rs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/TODO.md b/TODO.md index 1c022ca..d0fc9d7 100644 --- a/TODO.md +++ b/TODO.md @@ -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? diff --git a/aquatic_http_load_test/src/network.rs b/aquatic_http_load_test/src/network.rs index 0e6b2a9..65e5335 100644 --- a/aquatic_http_load_test/src/network.rs +++ b/aquatic_http_load_test/src/network.rs @@ -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;