diff --git a/http.go b/http.go index 09f5b04eaf..7b3c51c4cf 100644 --- a/http.go +++ b/http.go @@ -1856,19 +1856,8 @@ func writeBodyFixedSize(w *bufio.Writer, r io.Reader, size int64) error { } } - // Unwrap a single limited reader for triggering sendfile path - // in net.TCPConn.ReadFrom. - lr, ok := r.(*io.LimitedReader) - if ok { - r = lr.R - } - n, err := copyZeroAlloc(w, r) - if ok { - lr.N -= n - } - if n != size && err == nil { err = fmt.Errorf("copied %d bytes from body stream instead of %d bytes", n, size) }