mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-02-24 05:02:14 +08:00
Fix: return pooled buffer when simple-obfs tls read error (#2643)
This commit is contained in:
parent
ae722bb1a0
commit
f92f34bb20
@ -28,10 +28,10 @@ type TLSObfs struct {
|
|||||||
func (to *TLSObfs) read(b []byte, discardN int) (int, error) {
|
func (to *TLSObfs) read(b []byte, discardN int) (int, error) {
|
||||||
buf := pool.Get(discardN)
|
buf := pool.Get(discardN)
|
||||||
_, err := io.ReadFull(to.Conn, buf)
|
_, err := io.ReadFull(to.Conn, buf)
|
||||||
|
pool.Put(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
pool.Put(buf)
|
|
||||||
|
|
||||||
sizeBuf := make([]byte, 2)
|
sizeBuf := make([]byte, 2)
|
||||||
_, err = io.ReadFull(to.Conn, sizeBuf)
|
_, err = io.ReadFull(to.Conn, sizeBuf)
|
||||||
|
Loading…
Reference in New Issue
Block a user