Skip to content

Commit

Permalink
[FIX] When DataChannel Label already exists , The message of the new …
Browse files Browse the repository at this point in the history
…DC cannot be forwarded. (#627)
  • Loading branch information
zjzhang-cn authored Dec 7, 2021
1 parent a5f3a22 commit 8bd68ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/sfu/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 8bd68ab

Please # to comment.