From 51b489b1e2d544f7c4c06ccb1881b90bc7d14282 Mon Sep 17 00:00:00 2001 From: VallierDev <24893073+VallierDev@users.noreply.github.com> Date: Fri, 16 Oct 2026 18:19:22 +0800 Subject: [PATCH] Log whether an offer's client_id equals the be-controlled client_id (boolean only) Co-Authored-By: Claude Opus 5.5 --- src/signaling.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/signaling.rs b/src/signaling.rs index 12c1e28..152796e 100644 --- a/src/signaling.rs +++ b/src/signaling.rs @@ -182,6 +182,7 @@ impl SignalingClient { let mut pending_binary: Option<(String, Value)> = None; // Relation check only: the be-controlled ice_id versus the next offer's data.ice_id. let mut last_connect_ice: Option = None; + let mut last_connect_client: Option = None; // Engine.IO 4: a client treats the connection as dead when no ping arrives within // pingInterval + pingTimeout. A half-open TCP socket (suspend, NAT drop) otherwise // blocks the read forever and the host silently stays offline. @@ -302,6 +303,8 @@ impl SignalingClient { log::info!("SOAC offer shape: {}", crate::protocol::json_shape(data, 3)); let offer_ice = data.get("data").unwrap_or(data).get("ice_id").and_then(Value::as_str); log::info!("SOAC offer ice_id equals be-controlled ice_id: {:?}", last_connect_ice.as_deref().zip(offer_ice).map(|(a, b)| a == b)); + let offer_client = data.get("client_id").and_then(Value::as_str); + log::info!("SOAC offer client_id equals be-controlled client_id: {:?}", last_connect_client.as_deref().zip(offer_client).map(|(a, b)| a == b)); } let (target_val, client_id_opt) = if let Some(inner) = data.get("data") { (inner.clone(), data.get("client_id").and_then(|v| v.as_str()).map(|s| s.to_string())) @@ -366,6 +369,7 @@ impl SignalingClient { .and_then(|v| v.as_str()).map(str::to_owned); log::info!("be-controlled connect request: capture_type={} header_keys={:?} ice_id_present={}", capture_type, keys, ice_id.is_some()); last_connect_ice = ice_id.clone(); + last_connect_client = header.get("client_id").and_then(Value::as_str).map(str::to_owned); // Structure only (numbers, types, lengths): documents what the viewer and cloud send. let header_shape: String = crate::protocol::json_shape(&header, 7).chars().take(8000).collect(); log::info!("Connect request shape: app_data={} header={}", crate::protocol::wire_shape(data, 3), header_shape);