From c53c3928ab4c1414224669e2d252401e841dbc5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sun, 5 Jul 2020 20:32:13 +0200 Subject: [PATCH] aquatic_http: fix clippy error, or at least log possible error --- aquatic_http/src/lib/network/connection.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/aquatic_http/src/lib/network/connection.rs b/aquatic_http/src/lib/network/connection.rs index 5fd7f2c..ab17183 100644 --- a/aquatic_http/src/lib/network/connection.rs +++ b/aquatic_http/src/lib/network/connection.rs @@ -108,7 +108,16 @@ impl EstablishedConnection { response.extend_from_slice(body); response.extend_from_slice(b"\r\n"); - self.stream.write(&response)?; + let bytes_written = self.stream.write(&response)?; + + if bytes_written != body.len(){ + ::log::error!( + "send_response: only {} out of {} bytes written", + bytes_written, + body.len() + ); + } + self.stream.flush()?; Ok(())