http: fix some clippy errors, including possible network bug

This commit is contained in:
Joakim Frostegård 2020-08-01 23:58:47 +02:00
parent c202d9ba41
commit 8fc09cb130
3 changed files with 24 additions and 28 deletions

View file

@ -58,16 +58,12 @@ impl Connection {
loop {
match self.stream.read(&mut self.read_buffer[self.bytes_read..]){
Ok(bytes_read) => {
self.bytes_read = bytes_read;
break;
self.bytes_read += bytes_read;
},
Err(err) if err.kind() == ErrorKind::WouldBlock => {
self.can_send_initial = false;
eprintln!("handle_read_event error would block: {}", err);
return;
break;
},
Err(err) => {
self.bytes_read = 0;