add buffer size option for udp connection
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user