mirror of
https://github.com/pion/webrtc.git
synced 2025-10-06 23:52:51 +08:00
Put SCTP Zero Checksum behind SettingEngine
Old versions of Pion break against it
This commit is contained in:
2
go.mod
2
go.mod
@@ -13,7 +13,7 @@ require (
|
|||||||
github.com/pion/randutil v0.1.0
|
github.com/pion/randutil v0.1.0
|
||||||
github.com/pion/rtcp v1.2.12
|
github.com/pion/rtcp v1.2.12
|
||||||
github.com/pion/rtp v1.8.3
|
github.com/pion/rtp v1.8.3
|
||||||
github.com/pion/sctp v1.8.12
|
github.com/pion/sctp v1.8.13
|
||||||
github.com/pion/sdp/v3 v3.0.8
|
github.com/pion/sdp/v3 v3.0.8
|
||||||
github.com/pion/srtp/v2 v2.0.18
|
github.com/pion/srtp/v2 v2.0.18
|
||||||
github.com/pion/stun v0.6.1
|
github.com/pion/stun v0.6.1
|
||||||
|
4
go.sum
4
go.sum
@@ -61,8 +61,8 @@ github.com/pion/rtp v1.8.2/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU
|
|||||||
github.com/pion/rtp v1.8.3 h1:VEHxqzSVQxCkKDSHro5/4IUUG1ea+MFdqR2R3xSpNU8=
|
github.com/pion/rtp v1.8.3 h1:VEHxqzSVQxCkKDSHro5/4IUUG1ea+MFdqR2R3xSpNU8=
|
||||||
github.com/pion/rtp v1.8.3/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU=
|
github.com/pion/rtp v1.8.3/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU=
|
||||||
github.com/pion/sctp v1.8.5/go.mod h1:SUFFfDpViyKejTAdwD1d/HQsCu+V/40cCs2nZIvC3s0=
|
github.com/pion/sctp v1.8.5/go.mod h1:SUFFfDpViyKejTAdwD1d/HQsCu+V/40cCs2nZIvC3s0=
|
||||||
github.com/pion/sctp v1.8.12 h1:2VX50pedElH+is6FI+OKyRTeN5oy4mrk2HjnGa3UCmY=
|
github.com/pion/sctp v1.8.13 h1:YUJR44pWM2FPUhkl8l+vDyF2EDE3aTWtr3c+LDhCRcQ=
|
||||||
github.com/pion/sctp v1.8.12/go.mod h1:cMLT45jqw3+jiJCrtHVwfQLnfR0MGZ4rgOJwUOIqLkI=
|
github.com/pion/sctp v1.8.13/go.mod h1:YKSgO/bO/6aOMP9LCie1DuD7m+GamiK2yIiPM6vH+GA=
|
||||||
github.com/pion/sdp/v3 v3.0.8 h1:yd/wkrS0nzXEAb+uwv1TL3SG/gzsTiXHVOtXtD7EKl0=
|
github.com/pion/sdp/v3 v3.0.8 h1:yd/wkrS0nzXEAb+uwv1TL3SG/gzsTiXHVOtXtD7EKl0=
|
||||||
github.com/pion/sdp/v3 v3.0.8/go.mod h1:B5xmvENq5IXJimIO4zfp6LAe1fD9N+kFv+V/1lOdz8M=
|
github.com/pion/sdp/v3 v3.0.8/go.mod h1:B5xmvENq5IXJimIO4zfp6LAe1fD9N+kFv+V/1lOdz8M=
|
||||||
github.com/pion/srtp/v2 v2.0.18 h1:vKpAXfawO9RtTRKZJbG4y0v1b11NZxQnxRl85kGuUlo=
|
github.com/pion/srtp/v2 v2.0.18 h1:vKpAXfawO9RtTRKZJbG4y0v1b11NZxQnxRl85kGuUlo=
|
||||||
|
@@ -109,7 +109,7 @@ func (r *SCTPTransport) Start(SCTPCapabilities) error {
|
|||||||
sctpAssociation, err := sctp.Client(sctp.Config{
|
sctpAssociation, err := sctp.Client(sctp.Config{
|
||||||
NetConn: dtlsTransport.conn,
|
NetConn: dtlsTransport.conn,
|
||||||
MaxReceiveBufferSize: r.api.settingEngine.sctp.maxReceiveBufferSize,
|
MaxReceiveBufferSize: r.api.settingEngine.sctp.maxReceiveBufferSize,
|
||||||
EnableZeroChecksum: true,
|
EnableZeroChecksum: r.api.settingEngine.sctp.enableZeroChecksum,
|
||||||
LoggerFactory: r.api.settingEngine.LoggerFactory,
|
LoggerFactory: r.api.settingEngine.LoggerFactory,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@@ -75,6 +75,7 @@ type SettingEngine struct {
|
|||||||
}
|
}
|
||||||
sctp struct {
|
sctp struct {
|
||||||
maxReceiveBufferSize uint32
|
maxReceiveBufferSize uint32
|
||||||
|
enableZeroChecksum bool
|
||||||
}
|
}
|
||||||
sdpMediaLevelFingerprints bool
|
sdpMediaLevelFingerprints bool
|
||||||
answeringDTLSRole DTLSRole
|
answeringDTLSRole DTLSRole
|
||||||
@@ -434,3 +435,10 @@ func (e *SettingEngine) SetDTLSKeyLogWriter(writer io.Writer) {
|
|||||||
func (e *SettingEngine) SetSCTPMaxReceiveBufferSize(maxReceiveBufferSize uint32) {
|
func (e *SettingEngine) SetSCTPMaxReceiveBufferSize(maxReceiveBufferSize uint32) {
|
||||||
e.sctp.maxReceiveBufferSize = maxReceiveBufferSize
|
e.sctp.maxReceiveBufferSize = maxReceiveBufferSize
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetSCTPZeroChecksum enables the zero checksum feature in SCTP.
|
||||||
|
// This removes the need to checksum every incoming/outgoing packet and will reduce
|
||||||
|
// latency and CPU usage. This feature is not backwards compatible so is disabled by default
|
||||||
|
func (e *SettingEngine) EnableSCTPZeroChecksum(isEnabled bool) {
|
||||||
|
e.sctp.enableZeroChecksum = isEnabled
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user