Fix filtering candidates (#901)
* Filter candidate after setting description * comment * Fix filtering candidates - For offer/answer from remote, do filtering before setting remote description so that Pion does not see filtered candidates - For offer/answer originating from server, do filtering after setting local description (comments in code) so that remote side does not see filtered candidates. - Make logging a little consistent and use right context. * Comment * TCP fallback config and UT (broken now) * log SDP only when preferring TCP * Remove TCP fallback test attempt
This commit is contained in:
@@ -183,20 +183,22 @@ func (p *ParticipantImpl) SendRefreshToken(token string) error {
|
||||
|
||||
func (p *ParticipantImpl) sendIceCandidate(c *webrtc.ICECandidate, target livekit.SignalTarget) {
|
||||
var filterOut bool
|
||||
var pcTransport *PCTransport
|
||||
p.lock.RLock()
|
||||
if target == livekit.SignalTarget_SUBSCRIBER {
|
||||
if p.iceConfig.PreferSubTcp && c.Protocol != webrtc.ICEProtocolTCP {
|
||||
filterOut = true
|
||||
p.subscriber.Logger().Infow("filtering out candidate", "candidate", c)
|
||||
pcTransport = p.subscriber
|
||||
}
|
||||
} else if target == livekit.SignalTarget_PUBLISHER {
|
||||
if p.iceConfig.PreferPubTcp && c.Protocol != webrtc.ICEProtocolTCP {
|
||||
filterOut = true
|
||||
p.publisher.Logger().Infow("filtering out candidate", "candidate", c)
|
||||
pcTransport = p.publisher
|
||||
}
|
||||
}
|
||||
p.lock.RUnlock()
|
||||
if filterOut {
|
||||
pcTransport.Logger().Infow("filtering out local candidate", "candidate", c)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user