From 38cde37cff9dba658b5fe5f1952e98b7c3869016 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Tue, 17 Mar 2026 11:50:22 +0000 Subject: [PATCH] fix(remoteingress-core): initialize disconnect reason only when set in hub loop break paths --- changelog.md | 6 ++++++ rust/crates/remoteingress-core/src/hub.rs | 4 +++- ts/00_commitinfo_data.ts | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 924d0fe..3b0bb44 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2026-03-17 - 4.8.6 - fix(remoteingress-core) +initialize disconnect reason only when set in hub loop break paths + +- Replace the default "unknown" disconnect reason with an explicitly assigned string and document that all hub loop exits set it before use +- Add an allow attribute for unused assignments to avoid warnings around the deferred initialization pattern + ## 2026-03-17 - 4.8.5 - fix(repo) no changes to commit diff --git a/rust/crates/remoteingress-core/src/hub.rs b/rust/crates/remoteingress-core/src/hub.rs index 5983bf1..bc1997f 100644 --- a/rust/crates/remoteingress-core/src/hub.rs +++ b/rust/crates/remoteingress-core/src/hub.rs @@ -735,7 +735,9 @@ async fn handle_edge_connection( // Single-owner I/O engine — no tokio::io::split, no mutex let mut tunnel_io = remoteingress_protocol::TunnelIo::new(tls_stream, Vec::new()); - let mut disconnect_reason = "unknown".to_string(); + // Assigned in every break path of the hub_loop before use at the end. + #[allow(unused_assignments)] + let mut disconnect_reason = String::new(); 'hub_loop: loop { // Drain completed stream cleanups from spawned tasks diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 20f0813..2dbd9bb 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@serve.zone/remoteingress', - version: '4.8.5', + version: '4.8.6', description: 'Edge ingress tunnel for DcRouter - accepts incoming TCP connections at network edge and tunnels them to DcRouter SmartProxy preserving client IP via PROXY protocol v1.' }