Skip to content

Commit

Permalink
Fix cached conn eats up read deadlines
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Sep 14, 2024
1 parent 1f376ac commit f7cd94b
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions common/bufio/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package bufio
import (
"io"
"net"
"time"

"github.com/sagernet/sing/common/buf"
M "github.com/sagernet/sing/common/metadata"
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit f7cd94b

Please sign in to comment.