diff --git a/component/snell/pool.go b/component/snell/pool.go index b169c128..6eda2a9d 100644 --- a/component/snell/pool.go +++ b/component/snell/pool.go @@ -3,6 +3,7 @@ package snell import ( "context" "net" + "time" "github.com/Dreamacro/clash/component/pool" @@ -61,6 +62,9 @@ func (pc *PoolConn) Write(b []byte) (int, error) { } func (pc *PoolConn) Close() error { + // clash use SetReadDeadline to break bidirectional copy between client and server. + // reset it before reuse connection to avoid io timeout error. + pc.Snell.Conn.SetReadDeadline(time.Time{}) pc.pool.Put(pc.Snell) return nil }