Bump : 0.5.4 : WHIP cleanup guarded by session id, stale detach task can't kill a newer stream on the same key

This commit is contained in:
2026-08-20 19:08:12 +01:00
parent f855e0e471
commit 0a039a97c4
6 changed files with 47 additions and 12 deletions
+5 -3
View File
@@ -12,6 +12,7 @@ use tokio::{
sync::mpsc::{self, Receiver},
};
use tracing::{debug, error, info, trace, warn};
use uuid::Uuid;
pub struct WebRtcProxyConfig {
pub proxy_port: i32,
@@ -24,9 +25,10 @@ pub struct WebrtcProxy {
socket: Arc<UdpSocket>,
public_addr: SocketAddr,
/// Trickle-ICE candidate channels for WHIP ingest.
/// Keyed by stream_key_id; sender stored here so PATCH handler
/// can forward candidates to the detach task.
pub trickle_tx: Arc<DashMap<i32, tokio::sync::mpsc::UnboundedSender<String>>>,
/// Keyed by stream_key_id; each entry is tagged with the owning session's
/// id so cleanup can remove only its own entry and never a newer session
/// that re-published on the same key.
pub trickle_tx: Arc<DashMap<i32, (Uuid, tokio::sync::mpsc::UnboundedSender<String>)>>,
}
const STUN_MAGIC: u32 = 0x2112A442;