From ff7c3a4616d98ca8b2ebaec7946a48e3e4d43e17 Mon Sep 17 00:00:00 2001 From: koe Date: Wed, 4 Sep 2024 17:52:09 -0500 Subject: [PATCH] use CloseCode::Abnormal instead of CloseCode::Normal in keepalive timeouts --- CHANGELOG.md | 1 + src/socket.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 532dcba..01c73b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## v0.6.3 - Allow users to use tokio v2.4.0 in their projects. See [#106](https://github.com/gbaranski/ezsockets/pull/106). +- Return `CloseCode::Abnormal` from keepalive timeouts instead of `CloseCode::Normal`. ## v0.6.2 diff --git a/src/socket.rs b/src/socket.rs index 961ed57..3575c91 100644 --- a/src/socket.rs +++ b/src/socket.rs @@ -666,7 +666,7 @@ async fn handle_heartbeat_sleep_elapsed( tracing::info!("closing connection due to timeout"); let _ = sink .send_raw(InRawMessage::new(RawMessage::Close(Some(CloseFrame { - code: CloseCode::Normal, + code: CloseCode::Abnormal, reason: String::from("remote partner is inactive"), })))) .await;