From 1e66b18e5260fed773f37df23ac2c74c22e2898d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sat, 16 Oct 2021 18:07:00 +0200 Subject: [PATCH] aquatic_ws network: don't send error response when message parse fails --- TODO.md | 3 +++ aquatic_ws/src/lib/network/mod.rs | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 25fd375..a8b0ac9 100644 --- a/TODO.md +++ b/TODO.md @@ -6,6 +6,9 @@ * aquatic_http * aquatic_ws, including sending back new error responses +* aquatic_ws: should it send back error on message parse error, or does that + just indicate that not enough data has been received yet? + * Consider turning on safety and override flags in mimalloc, mostly for simd-json. It might be faster to just stop using simd-json if I consider it insecure, which it maybe isn't. diff --git a/aquatic_ws/src/lib/network/mod.rs b/aquatic_ws/src/lib/network/mod.rs index 75780b0..f12859d 100644 --- a/aquatic_ws/src/lib/network/mod.rs +++ b/aquatic_ws/src/lib/network/mod.rs @@ -237,7 +237,9 @@ pub fn run_handshakes_and_read_messages( error!("InMessageSender: couldn't send message: {:?}", err); } } - Err(err) => { + Err(_) => { + // FIXME: maybe this condition just occurs when enough data hasn't been recevied? + /* info!("error parsing message: {:?}", err); let out_message = OutMessage::ErrorResponse(ErrorResponse { @@ -247,6 +249,7 @@ pub fn run_handshakes_and_read_messages( }); local_responses.push((meta, out_message)); + */ } } }