update bufpool

This commit is contained in:
ginuerzh
2023-10-19 23:48:23 +08:00
parent f08c814602
commit d354cf2539
3 changed files with 19 additions and 20 deletions

View File

@ -37,7 +37,7 @@ func (c *conn) ReadFrom(b []byte) (n int, addr net.Addr, err error) {
case bb := <-c.rc:
n = copy(b, bb)
c.SetIdle(false)
bufpool.Put(&bb)
bufpool.Put(bb)
case <-c.closed:
err = net.ErrClosed