From d2d3c82ccf81d43403291ae4a6d90393709c2b30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Fri, 28 Apr 2023 11:21:36 +0800 Subject: [PATCH] Fix wait copy packet --- common/dialer/conntrack/packet_conn.go | 3 ++- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/common/dialer/conntrack/packet_conn.go b/common/dialer/conntrack/packet_conn.go index 3ae3f39d..6e2d925b 100644 --- a/common/dialer/conntrack/packet_conn.go +++ b/common/dialer/conntrack/packet_conn.go @@ -4,6 +4,7 @@ import ( "io" "net" + "github.com/sagernet/sing/common/bufio" "github.com/sagernet/sing/common/x/list" ) @@ -42,7 +43,7 @@ func (c *PacketConn) Close() error { } func (c *PacketConn) Upstream() any { - return c.PacketConn + return bufio.NewPacketConn(c.PacketConn) } func (c *PacketConn) ReaderReplaceable() bool { diff --git a/go.mod b/go.mod index 9d960954..2cddbfce 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/sagernet/gomobile v0.0.0-20230413023804-244d7ff07035 github.com/sagernet/quic-go v0.0.0-20230202071646-a8c8afb18b32 github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 - github.com/sagernet/sing v0.2.5-0.20230425211221-a23ffbaeb5b9 + github.com/sagernet/sing v0.2.5-0.20230427151730-ed2d05ab518a github.com/sagernet/sing-dns v0.1.5-0.20230426113254-25d948c44223 github.com/sagernet/sing-mux v0.0.0-20230425130511-b0a6ffd8406f github.com/sagernet/sing-shadowsocks v0.2.2-0.20230417102954-f77257340507 diff --git a/go.sum b/go.sum index 7b6651c1..7f2ab351 100644 --- a/go.sum +++ b/go.sum @@ -111,8 +111,8 @@ github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 h1:5Th31OC6yj8byL github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691/go.mod h1:B8lp4WkQ1PwNnrVMM6KyuFR20pU8jYBD+A4EhJovEXU= github.com/sagernet/sing v0.0.0-20220817130738-ce854cda8522/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY= github.com/sagernet/sing v0.1.8/go.mod h1:jt1w2u7lJQFFSGLiRrRIs5YWmx4kAPfWuOejuDW9qMk= -github.com/sagernet/sing v0.2.5-0.20230425211221-a23ffbaeb5b9 h1:kpgKJbhesj6BBLTKIfBCJGQPm2ww7pNxn566C6TrHdA= -github.com/sagernet/sing v0.2.5-0.20230425211221-a23ffbaeb5b9/go.mod h1:Ta8nHnDLAwqySzKhGoKk4ZIB+vJ3GTKj7UPrWYvM+4w= +github.com/sagernet/sing v0.2.5-0.20230427151730-ed2d05ab518a h1:qQ4fG1XrlTbLvtkJK5SbtIGJ4cIjObvVjL1AvhD+vrI= +github.com/sagernet/sing v0.2.5-0.20230427151730-ed2d05ab518a/go.mod h1:Ta8nHnDLAwqySzKhGoKk4ZIB+vJ3GTKj7UPrWYvM+4w= github.com/sagernet/sing-dns v0.1.5-0.20230426113254-25d948c44223 h1:L4eMuM07iSHY3UCknFnuFuHoe5clZuF2Xnf2wwA6Lwc= github.com/sagernet/sing-dns v0.1.5-0.20230426113254-25d948c44223/go.mod h1:ZKuuqgsHRxDahYrzgSgy4vIAGGuKPlIf4hLcNzYzLkY= github.com/sagernet/sing-mux v0.0.0-20230425130511-b0a6ffd8406f h1:iEpOTgBTjt0vZJVXMTqYq13XyIu/337TWbq6WZ3CMWc=