From dfeb901417257fda1bd0640a31661ceb92bb17cf Mon Sep 17 00:00:00 2001 From: metacubex Date: Fri, 12 Aug 2022 12:53:11 +0800 Subject: [PATCH] Fix: no_gviosr tags --- listener/tun/ipstack/gvisor/option/option.go | 10 +++++----- listener/tun/ipstack/gvisor/tcp.go | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) 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 (