mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-01 19:07:38 +03:00
Fix cached conn eats up read deadlines
This commit is contained in:
parent
c324d4143d
commit
6567829958
1 changed files with 0 additions and 8 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue