diff --git a/listener/tun/ipstack/gvisor/option/option.go b/listener/tun/ipstack/gvisor/option/option.go index a2fb2851..88c26e62 100644 --- a/listener/tun/ipstack/gvisor/option/option.go +++ b/listener/tun/ipstack/gvisor/option/option.go @@ -1,5 +1,3 @@ -//go:build !no_gvisor - package option import ( @@ -11,6 +9,8 @@ import ( "gvisor.dev/gvisor/pkg/tcpip/network/ipv6" "gvisor.dev/gvisor/pkg/tcpip/stack" "gvisor.dev/gvisor/pkg/tcpip/transport/tcp" + + "github.com/Dreamacro/clash/common/pool" ) const ( @@ -52,15 +52,15 @@ const ( tcpMinBufferSize = tcp.MinBufferSize // tcpMaxBufferSize is the maximum permitted size of a send/recv buffer. - tcpMaxBufferSize = tcp.MaxBufferSize + tcpMaxBufferSize = pool.RelayBufferSize // tcpDefaultBufferSize is the default size of the send buffer for // a transport endpoint. - tcpDefaultSendBufferSize = tcp.DefaultSendBufferSize + tcpDefaultSendBufferSize = pool.RelayBufferSize // tcpDefaultReceiveBufferSize is the default size of the receive buffer // for a transport endpoint. - tcpDefaultReceiveBufferSize = tcp.DefaultReceiveBufferSize + tcpDefaultReceiveBufferSize = pool.RelayBufferSize ) type Option func(*stack.Stack) error diff --git a/listener/tun/ipstack/gvisor/tcp.go b/listener/tun/ipstack/gvisor/tcp.go index b5dad6ea..4798cb7c 100644 --- a/listener/tun/ipstack/gvisor/tcp.go +++ b/listener/tun/ipstack/gvisor/tcp.go @@ -1,3 +1,5 @@ +//go:build !no_gvisor + package gvisor import (