Skip to content

Commit 9a8285a

Browse files
committed
rwconn: use core.Stream instead of io.Copy
1 parent e9a28f7 commit 9a8285a

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

intra/rwconn.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,8 @@ func (rw rwext) ReadFrom(r io.Reader) (n int64, err error) {
5959
return c.ReadFrom(r)
6060
default:
6161
}
62-
bptr := core.Alloc()
63-
b := *bptr
64-
defer func() {
65-
*bptr = b
66-
core.Recycle(bptr)
67-
}()
68-
return io.CopyBuffer(rw, r, b)
62+
// nb: stream rw (which extends deadlines) not rw.Conn
63+
return core.Stream(rw, r)
6964
}
7065

7166
func (rw rwext) deadlines() (r, w uint32) {

0 commit comments

Comments
 (0)