mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-10-12 02:08:11 +08:00
fix: consume CachedConn data in ReadCached
This commit is contained in:
1 parent
aea5ce4142
commit
a35045d9f1
1 file changed
+3
-1
@@ -28,7 +28,9 @@ func (c *CachedConn) Read(b []byte) (n int, err error) {
|
||||
|
||||
func (c *CachedConn) ReadCached() *buf.Buffer { // call in sing/common/bufio.Copy
|
||||
if len(c.data) > 0 {
|
||||
return buf.As(c.data)
|
||||
data := c.data
|
||||
c.data = nil
|
||||
return buf.As(data)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user