fix: close stream adaptive gaps and switch notify to stario v0.1.1
- make stream fast path honor adaptive soft payload limits end-to-end - split oversized fast-stream payloads into sequential frames before batching - use adaptive soft cap when encoding stream batch payloads - move timeout-like error detection into production code for adaptive tx - tune notify FrameReader read size explicitly to avoid throughput regression - drop local stario replace and depend on released b612.me/stario v0.1.1
This commit is contained in:
@@ -35,6 +35,7 @@ func (s *ServerCommon) SetDefaultCommEncode(fn func([]byte, []byte) []byte) {
|
||||
s.defaultFastStreamEncode = nil
|
||||
s.defaultFastBulkEncode = nil
|
||||
s.defaultFastPlainEncode = nil
|
||||
s.defaultModernPSKRuntime = nil
|
||||
s.securityReadyCheck = false
|
||||
}
|
||||
|
||||
@@ -45,6 +46,7 @@ func (s *ServerCommon) SetDefaultCommDecode(fn func([]byte, []byte) []byte) {
|
||||
s.defaultFastStreamEncode = nil
|
||||
s.defaultFastBulkEncode = nil
|
||||
s.defaultFastPlainEncode = nil
|
||||
s.defaultModernPSKRuntime = nil
|
||||
s.securityReadyCheck = false
|
||||
}
|
||||
|
||||
@@ -97,6 +99,13 @@ func (s *ServerCommon) GetSecretKey() []byte {
|
||||
// Prefer UseModernPSKServer or UseLegacySecurityServer.
|
||||
func (s *ServerCommon) SetSecretKey(key []byte) {
|
||||
s.SecretKey = key
|
||||
if len(key) == 0 {
|
||||
s.defaultModernPSKRuntime = nil
|
||||
} else if runtime, err := newModernPSKCodecRuntime(key, defaultModernPSKAAD); err == nil {
|
||||
s.defaultModernPSKRuntime = runtime
|
||||
} else {
|
||||
s.defaultModernPSKRuntime = nil
|
||||
}
|
||||
s.securityReadyCheck = len(key) == 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user