Disable active TCP by rolling back to ICE v2.3.3 (#1735)

* Revert "Disable active TCP (#1726)"

This reverts commit 5260907ffe.

* Disable active TCP by rolling back to ICE v2.3.3
This commit is contained in:
David Zhao
2023-05-23 21:27:03 -07:00
committed by GitHub
parent bbbe815260
commit 61d393e709
3 changed files with 22 additions and 25 deletions
+5 -15
View File
@@ -1478,16 +1478,11 @@ func (t *PCTransport) handleLocalICECandidate(e *event) error {
c := e.data.(*webrtc.ICECandidate)
filtered := false
if c != nil {
if t.preferTCP.Load() && c.Protocol != webrtc.ICEProtocolTCP {
cstr := c.String()
t.params.Logger.Debugw("filtering out local candidate", "candidate", cstr)
t.filteredLocalCandidates = append(t.filteredLocalCandidates, cstr)
filtered = true
} else if c.Protocol == webrtc.ICEProtocolTCP && c.TCPType == ice.TCPTypeActive.String() {
// SFU should not support TCP active candidates. clients should connect to us
filtered = true
}
if t.preferTCP.Load() && c != nil && c.Protocol != webrtc.ICEProtocolTCP {
cstr := c.String()
t.params.Logger.Debugw("filtering out local candidate", "candidate", cstr)
t.filteredLocalCandidates = append(t.filteredLocalCandidates, cstr)
filtered = true
}
if filtered {
@@ -1517,11 +1512,6 @@ func (t *PCTransport) handleRemoteICECandidate(e *event) error {
t.params.Logger.Debugw("filtering out remote candidate", "candidate", c.Candidate)
t.filteredRemoteCandidates = append(t.filteredRemoteCandidates, c.Candidate)
filtered = true
} else if candidate, err := ice.UnmarshalCandidate(c.Candidate); err == nil {
if candidate != nil && candidate.TCPType() == ice.TCPTypePassive {
// SFU should ignore client's passive TCP, so Pion doesn't attempt to connect to it
filtered = true
}
}
if filtered {