mirror of
https://github.com/pion/webrtc.git
synced 2025-09-27 11:32:19 +08:00
Support DataChannel messages larger then MaxUint16
SCTP now internally can handle larger messages Resolves #2712
This commit is contained in:
@@ -83,6 +83,7 @@ type SettingEngine struct {
|
||||
maxReceiveBufferSize uint32
|
||||
enableZeroChecksum bool
|
||||
rtoMax time.Duration
|
||||
maxMessageSize uint32
|
||||
}
|
||||
sdpMediaLevelFingerprints bool
|
||||
answeringDTLSRole DTLSRole
|
||||
@@ -106,6 +107,14 @@ type SettingEngine struct {
|
||||
dataChannelBlockWrite bool
|
||||
}
|
||||
|
||||
func (e *SettingEngine) getSCTPMaxMessageSize() uint32 {
|
||||
if e.sctp.maxMessageSize != 0 {
|
||||
return e.sctp.maxMessageSize
|
||||
}
|
||||
|
||||
return defaultMaxSCTPMessageSize
|
||||
}
|
||||
|
||||
// getReceiveMTU returns the configured MTU. If SettingEngine's MTU is configured to 0 it returns the default.
|
||||
func (e *SettingEngine) getReceiveMTU() uint {
|
||||
if e.receiveMTU != 0 {
|
||||
@@ -467,6 +476,12 @@ func (e *SettingEngine) EnableSCTPZeroChecksum(isEnabled bool) {
|
||||
e.sctp.enableZeroChecksum = isEnabled
|
||||
}
|
||||
|
||||
// SetSCTPMaxMessageSize sets the largest message we are willing to accept.
|
||||
// Leave this 0 for the default max message size.
|
||||
func (e *SettingEngine) SetSCTPMaxMessageSize(maxMessageSize uint32) {
|
||||
e.sctp.maxMessageSize = maxMessageSize
|
||||
}
|
||||
|
||||
// SetDTLSCustomerCipherSuites allows the user to specify a list of DTLS CipherSuites.
|
||||
// This allow usage of Ciphers that are reserved for private usage.
|
||||
func (e *SettingEngine) SetDTLSCustomerCipherSuites(customCipherSuites func() []dtls.CipherSuite) {
|
||||
|
Reference in New Issue
Block a user