From 9625511c6550a8eb2d0468a779c33208d12de272 Mon Sep 17 00:00:00 2001 From: Mollusk Date: Fri, 22 May 2026 03:50:20 -0400 Subject: [PATCH] cleanup: demote clean-disconnect warn, drop dead --low-latency flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit handle_peer's `bridge ended with error: ...` log fired at WARN every time a viewer cleanly closed — but bridge can only end three ways (peer-close, local-socket-close, cancellation), none of which are real errors. Collapsed to INFO for both Ok and Err arms; the message itself still carries any error detail. Also removed the `--low-latency` CLI flag and its HostOpts field. It was a placeholder for an unimplemented Phase-2/3 SRT transport, never read anywhere, and was generating a persistent dead_code warning. If SRT ever happens, the flag can come back fresh. Co-Authored-By: Claude Opus 4.7 --- src/cli.rs | 6 ------ src/host/mod.rs | 11 ++++------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 467edea..1fd2a5a 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -41,10 +41,6 @@ pub struct Cli { #[arg(long)] pub no_hwencode: bool, - /// Use low-latency SRT transport instead of HTTP MPEG-TS (Phase 2/3). - #[arg(long)] - pub low_latency: bool, - /// Maximum number of concurrent viewers. Additional connections are /// politely refused with a "host full" message. Defaults to the /// connection-aware recommendation from the bandwidth pre-flight if @@ -88,7 +84,6 @@ pub struct HostOpts { pub bitrate: u32, pub framerate: u32, pub no_hwencode: bool, - pub low_latency: bool, pub max_viewers: Option, pub interactive: bool, } @@ -109,7 +104,6 @@ impl Cli { bitrate: self.bitrate, framerate: self.framerate, no_hwencode: self.no_hwencode, - low_latency: self.low_latency, max_viewers: self.max_viewers, interactive, } diff --git a/src/host/mod.rs b/src/host/mod.rs index f0a9eb6..6bfbac7 100644 --- a/src/host/mod.rs +++ b/src/host/mod.rs @@ -147,13 +147,10 @@ async fn handle_peer( let bridge = tunnel::bridge(quic_send, quic_recv, tcp); tokio::select! { - res = bridge => { - if let Err(e) = res { - tracing::warn!(%remote, "bridge ended with error: {e:#}"); - } else { - tracing::info!(%remote, "bridge closed cleanly"); - } - } + res = bridge => match res { + Ok(()) => tracing::info!(%remote, "bridge closed cleanly"), + Err(e) => tracing::info!(%remote, "bridge ended: {e:#}"), + }, _ = cancel.cancelled() => { tracing::info!(%remote, "cancellation during stream"); }