improvement: better logging for connection resets

This commit is contained in:
Greg Heartsfield 2022-02-21 08:57:07 -06:00
parent 3b25160852
commit 2f63417646

View File

@ -459,11 +459,17 @@ async fn nostr_server(
continue; continue;
}, },
Some(Ok(Message::Ping(_))) | Some(Ok(Message::Pong(_))) => { Some(Ok(Message::Ping(_))) | Some(Ok(Message::Pong(_))) => {
// get a ping/pong, ignore // get a ping/pong, ignore. tungstenite will
// send responses automatically.
continue; continue;
}, },
None | Some(Ok(Message::Close(_))) | Some(Err(WsError::AlreadyClosed)) | Some(Err(WsError::ConnectionClosed)) => { None |
debug!("normal websocket close from client: {:?}",cid); 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; break;
}, },
Some(Err(WsError::Io(e))) => { Some(Err(WsError::Io(e))) => {