From ba19c978a52266dd344679d3483f7a75f52a4bad Mon Sep 17 00:00:00 2001 From: Greg Heartsfield Date: Tue, 23 Nov 2021 12:47:02 -0600 Subject: [PATCH] More error handling/debugging --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 87b8c2a..f4d369f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -86,6 +86,7 @@ async fn process_client(stream: WebSocketStream) { ))) .await .expect("send failed"); + // Handle this request. Everything else below is basically error handling. } Ok(Message::Binary(_)) => { info!("Ignoring Binary message"); @@ -129,7 +130,8 @@ async fn process_client(stream: WebSocketStream) { debug!("Closing this connection normally"); return; } - Err(Tls(_)) | Err(Protocol(_)) | Err(Utf8) | Err(Url(_)) => { + Err(Tls(_)) | Err(Protocol(_)) | Err(Utf8) | Err(Url(_)) | Err(HttpFormat(_)) + | Err(Http(_)) => { info!("websocket/tls/enc protocol error, dropping connection"); return; }