add backup filter
This commit is contained in:
@ -5,7 +5,7 @@ import (
|
||||
"time"
|
||||
|
||||
mdata "github.com/go-gost/core/metadata"
|
||||
mdx "github.com/go-gost/x/metadata"
|
||||
mdutil "github.com/go-gost/core/metadata/util"
|
||||
)
|
||||
|
||||
type metadata struct {
|
||||
@ -23,11 +23,11 @@ func (h *relayHandler) parseMetadata(md mdata.Metadata) (err error) {
|
||||
noDelay = "nodelay"
|
||||
)
|
||||
|
||||
h.md.readTimeout = mdx.GetDuration(md, readTimeout)
|
||||
h.md.enableBind = mdx.GetBool(md, enableBind)
|
||||
h.md.noDelay = mdx.GetBool(md, noDelay)
|
||||
h.md.readTimeout = mdutil.GetDuration(md, readTimeout)
|
||||
h.md.enableBind = mdutil.GetBool(md, enableBind)
|
||||
h.md.noDelay = mdutil.GetBool(md, noDelay)
|
||||
|
||||
if bs := mdx.GetInt(md, udpBufferSize); bs > 0 {
|
||||
if bs := mdutil.GetInt(md, udpBufferSize); bs > 0 {
|
||||
h.md.udpBufferSize = int(math.Min(math.Max(float64(bs), 512), 64*1024))
|
||||
} else {
|
||||
h.md.udpBufferSize = 1500
|
||||
|
Reference in New Issue
Block a user