add buffer size option for udp connection

This commit is contained in:
ginuerzh
2025-07-30 21:40:53 +08:00
parent b64e5901b6
commit a5309eee97
26 changed files with 218 additions and 219 deletions
+7 -10
View File
@@ -1,7 +1,6 @@
package ss
import (
"math"
"time"
mdata "github.com/go-gost/core/metadata"
@@ -9,22 +8,20 @@ import (
)
const (
MaxMessageSize = math.MaxUint16
defaultBufferSize = 4096
)
type metadata struct {
key string
readTimeout time.Duration
key string
readTimeout time.Duration
udpBufferSize int
}
func (h *ssuHandler) parseMetadata(md mdata.Metadata) (err error) {
const (
key = "key"
readTimeout = "readTimeout"
)
h.md.key = mdutil.GetString(md, key)
h.md.readTimeout = mdutil.GetDuration(md, readTimeout)
h.md.key = mdutil.GetString(md, "key")
h.md.readTimeout = mdutil.GetDuration(md, "readTimeout")
h.md.udpBufferSize = mdutil.GetInt(md, "udpBufferSize", "udp.bufferSize")
return
}