change []byte bufpool to *[]byte

This commit is contained in:
ginuerzh
2022-01-06 09:50:37 +08:00
parent 3b48c4acfb
commit f45dc93e92
16 changed files with 98 additions and 86 deletions

View File

@ -35,7 +35,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