nostr-rs-relay

My dev fork of nostr-rs-relay
git clone git://jb55.com/nostr-rs-relay
Log | Files | Refs | README | LICENSE

commit 2f63417646ad20ee5a499974f79083062b295d8a
parent 3b2516085245db73f17545cc4a38997f07ff7071
Author: Greg Heartsfield <scsibug@imap.cc>
Date:   Mon, 21 Feb 2022 08:57:07 -0600

improvement: better logging for connection resets

Diffstat:
Msrc/main.rs | 12+++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/main.rs b/src/main.rs @@ -459,11 +459,17 @@ async fn nostr_server( continue; }, Some(Ok(Message::Ping(_))) | Some(Ok(Message::Pong(_))) => { - // get a ping/pong, ignore + // get a ping/pong, ignore. tungstenite will + // send responses automatically. continue; }, - None | Some(Ok(Message::Close(_))) | Some(Err(WsError::AlreadyClosed)) | Some(Err(WsError::ConnectionClosed)) => { - debug!("normal websocket close from client: {:?}",cid); + None | + Some(Ok(Message::Close(_))) | + Some(Err(WsError::AlreadyClosed)) | + Some(Err(WsError::ConnectionClosed)) | + Some(Err(WsError::Protocol(tungstenite::error::ProtocolError::ResetWithoutClosingHandshake))) + => { + debug!("websocket close from client: {:?}",cid); break; }, Some(Err(WsError::Io(e))) => {