From 65678299587913fefa8b9ab83e86cf33d82fe0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sat, 14 Sep 2024 10:11:50 +0800 Subject: [PATCH] Fix cached conn eats up read deadlines --- common/bufio/cache.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/common/bufio/cache.go b/common/bufio/cache.go index e1eda0a..ace7259 100644 --- a/common/bufio/cache.go +++ b/common/bufio/cache.go @@ -3,7 +3,6 @@ package bufio import ( "io" "net" - "time" "github.com/sagernet/sing/common/buf" M "github.com/sagernet/sing/common/metadata" @@ -60,13 +59,6 @@ func (c *CachedConn) WriteTo(w io.Writer) (n int64, err error) { return } -func (c *CachedConn) SetReadDeadline(t time.Time) error { - if c.buffer != nil && !c.buffer.IsEmpty() { - return nil - } - return c.Conn.SetReadDeadline(t) -} - func (c *CachedConn) ReadFrom(r io.Reader) (n int64, err error) { return Copy(c.Conn, r) }