Skip to content

Commit acefe59

Browse files
committed
chore: full reset buffer after directRead
1 parent e5e097f commit acefe59

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ require (
3131
github.com/metacubex/sing-shadowsocks2 v0.2.6
3232
github.com/metacubex/sing-shadowtls v0.0.0-20250503063515-5d9f966d17a2
3333
github.com/metacubex/sing-tun v0.4.8-0.20250827085914-fc5681b9fc9f
34-
github.com/metacubex/sing-vmess v0.2.4-0.20250822020810-4856053566f0
34+
github.com/metacubex/sing-vmess v0.2.4-0.20250828081059-57e77685eef9
3535
github.com/metacubex/sing-wireguard v0.0.0-20250503063753-2dc62acc626f
3636
github.com/metacubex/smux v0.0.0-20250503055512-501391591dee
3737
github.com/metacubex/tfo-go v0.0.0-20250827083229-aa432b865617

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ github.com/metacubex/sing-shadowtls v0.0.0-20250503063515-5d9f966d17a2 h1:gXU+MY
131131
github.com/metacubex/sing-shadowtls v0.0.0-20250503063515-5d9f966d17a2/go.mod h1:mbfboaXauKJNIHJYxQRa+NJs4JU9NZfkA+I33dS2+9E=
132132
github.com/metacubex/sing-tun v0.4.8-0.20250827085914-fc5681b9fc9f h1:1MV/pFn2vjnyvH/0u6sJST0kmaoZXgbUytCCfuelhl8=
133133
github.com/metacubex/sing-tun v0.4.8-0.20250827085914-fc5681b9fc9f/go.mod h1:FQ9zXA+kVhdzqgFqeJdi/AUhJgUgw+SUXqrR++GvbnM=
134-
github.com/metacubex/sing-vmess v0.2.4-0.20250822020810-4856053566f0 h1:WZepq4TOZa6WewB8tGAZrrL+bL2R2ivoBzuEgAeolWc=
135-
github.com/metacubex/sing-vmess v0.2.4-0.20250822020810-4856053566f0/go.mod h1:21R5R1u90uUvBQF0owoooEu96/SAYYD56nDrwm6nFaM=
134+
github.com/metacubex/sing-vmess v0.2.4-0.20250828081059-57e77685eef9 h1:VP7rBmRJUqBpP8uJQpzEqCgnbAYWbz2QtWqoBdNrmwU=
135+
github.com/metacubex/sing-vmess v0.2.4-0.20250828081059-57e77685eef9/go.mod h1:21R5R1u90uUvBQF0owoooEu96/SAYYD56nDrwm6nFaM=
136136
github.com/metacubex/sing-wireguard v0.0.0-20250503063753-2dc62acc626f h1:Sr/DYKYofKHKc4GF3qkRGNuj6XA6c0eqPgEDN+VAsYU=
137137
github.com/metacubex/sing-wireguard v0.0.0-20250503063753-2dc62acc626f/go.mod h1:jpAkVLPnCpGSfNyVmj6Cq4YbuZsFepm/Dc+9BAOcR80=
138138
github.com/metacubex/smux v0.0.0-20250503055512-501391591dee h1:lp6hJ+4wCLZu113awp7P6odM2okB5s60HUyF0FMqKmo=

transport/vless/vision/conn.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ func (vc *Conn) ReadBuffer(buffer *buf.Buffer) error {
125125
}
126126
if vc.input.Len() == 0 {
127127
needReturn = true
128+
*vc.input = bytes.Reader{} // full reset
128129
vc.input = nil
129130
} else { // buffer is full
130131
return nil
@@ -139,6 +140,7 @@ func (vc *Conn) ReadBuffer(buffer *buf.Buffer) error {
139140
}
140141
needReturn = true
141142
if vc.rawInput.Len() == 0 {
143+
*vc.rawInput = bytes.Buffer{} // full reset
142144
vc.rawInput = nil
143145
}
144146
}

0 commit comments

Comments
 (0)