From 8bd68abd9b920ab7896b65a5d0046a4ef1f794d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BA=BA=E7=94=9F?= Date: Tue, 7 Dec 2021 18:40:42 +0800 Subject: [PATCH] [FIX] When DataChannel Label already exists , The message of the new DC cannot be forwarded. (#627) --- pkg/sfu/session.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/sfu/session.go b/pkg/sfu/session.go index 76eee20c8..9d7895e73 100644 --- a/pkg/sfu/session.go +++ b/pkg/sfu/session.go @@ -161,6 +161,9 @@ func (s *SessionLocal) AddDatachannel(owner string, dc *webrtc.DataChannel) { s.mu.Lock() for _, lbl := range s.fanOutDCs { if label == lbl { + dc.OnMessage(func(msg webrtc.DataChannelMessage) { + s.FanOutMessage(owner, label, msg) + }) s.mu.Unlock() return }