Disable SCTP zero checksum for old go client (#3319)

Old go-sdks with old pion/sctp version can't
process unknown parameters.
This commit is contained in:
cnderrauber
2025-01-09 13:22:23 +08:00
committed by GitHub
parent 0d9bad489c
commit f846c7719b
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ func (c ClientInfo) SupportErrorResponse() bool {
} }
func (c ClientInfo) SupportSctpZeroChecksum() bool { func (c ClientInfo) SupportSctpZeroChecksum() bool {
return !(c.isGo() && c.compareVersion("2.1.3") <= 0) return !(c.isGo() && c.compareVersion("2.4.0") < 0)
} }
// compareVersion compares a semver against the current client SDK version // compareVersion compares a semver against the current client SDK version
-2
View File
@@ -69,8 +69,6 @@ func NewWebRTCConfig(conf *config.Config) (*WebRTCConfig, error) {
// we don't want to use active TCP on a server, clients should be dialing // we don't want to use active TCP on a server, clients should be dialing
webRTCConfig.SettingEngine.DisableActiveTCP(true) webRTCConfig.SettingEngine.DisableActiveTCP(true)
webRTCConfig.SettingEngine.EnableSCTPZeroChecksum(true)
if rtcConf.PacketBufferSize == 0 { if rtcConf.PacketBufferSize == 0 {
rtcConf.PacketBufferSize = 500 rtcConf.PacketBufferSize = 500
} }
+4
View File
@@ -306,6 +306,10 @@ func newPeerConnection(params TransportParams, onBandwidthEstimator func(estimat
se.SetFireOnTrackBeforeFirstRTP(true) se.SetFireOnTrackBeforeFirstRTP(true)
} }
if params.ClientInfo.SupportSctpZeroChecksum() {
se.EnableSCTPZeroChecksum(true)
}
// //
// Disable SRTP replay protection (https://datatracker.ietf.org/doc/html/rfc3711#page-15). // Disable SRTP replay protection (https://datatracker.ietf.org/doc/html/rfc3711#page-15).
// Needed due to lack of RTX stream support in Pion. // Needed due to lack of RTX stream support in Pion.