Commit fdbae7d7 authored by Sameer Ajmani's avatar Sameer Ajmani Committed by Brad Fitzpatrick

net/http/httputil: don't log read error when it's context.Canceled

Fixes #18838

Change-Id: I44976cadb0dc3c23eacb8cdd58429a572cd8d28a
Reviewed-on: https://go-review.googlesource.com/36358Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 2ca5d105
...@@ -286,7 +286,7 @@ func (p *ReverseProxy) copyBuffer(dst io.Writer, src io.Reader, buf []byte) (int ...@@ -286,7 +286,7 @@ func (p *ReverseProxy) copyBuffer(dst io.Writer, src io.Reader, buf []byte) (int
var written int64 var written int64
for { for {
nr, rerr := src.Read(buf) nr, rerr := src.Read(buf)
if rerr != nil && rerr != io.EOF { if rerr != nil && rerr != io.EOF && rerr != context.Canceled {
p.logf("httputil: ReverseProxy read error during body copy: %v", rerr) p.logf("httputil: ReverseProxy read error during body copy: %v", rerr)
} }
if nr > 0 { if nr > 0 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment