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:
2026-04-18 16:05:57 +08:00
parent 4f760f2807
commit f038a89771
76 changed files with 12656 additions and 906 deletions
+9
View File
@@ -75,6 +75,7 @@ func (c *ClientCommon) SetMsgEn(fn func([]byte, []byte) []byte) {
c.fastStreamEncode = nil
c.fastBulkEncode = nil
c.fastPlainEncode = nil
c.modernPSKRuntime = nil
c.securityReadyCheck = false
}
@@ -89,6 +90,7 @@ func (c *ClientCommon) SetMsgDe(fn func([]byte, []byte) []byte) {
c.fastStreamEncode = nil
c.fastBulkEncode = nil
c.fastPlainEncode = nil
c.modernPSKRuntime = nil
c.securityReadyCheck = false
}
@@ -108,6 +110,13 @@ func (c *ClientCommon) GetSecretKey() []byte {
// Prefer UseModernPSKClient or UseLegacySecurityClient.
func (c *ClientCommon) SetSecretKey(key []byte) {
c.SecretKey = key
if len(key) == 0 {
c.modernPSKRuntime = nil
} else if runtime, err := newModernPSKCodecRuntime(key, defaultModernPSKAAD); err == nil {
c.modernPSKRuntime = runtime
} else {
c.modernPSKRuntime = nil
}
c.securityReadyCheck = len(key) == 0
c.skipKeyExchange = true
}