1
0
mirror of https://github.com/golang/go synced 2024-11-12 08:00:22 -07:00

net/http: don't drop error on request write

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7230059
This commit is contained in:
Gustavo Niemeyer 2013-02-27 21:15:36 -03:00
parent f12796e9f7
commit 64648986e3

View File

@ -194,10 +194,11 @@ func (t *transferWriter) WriteBody(w io.Writer) (err error) {
ncopy, err = io.Copy(w, t.Body)
} else {
ncopy, err = io.Copy(w, io.LimitReader(t.Body, t.ContentLength))
nextra, err := io.Copy(ioutil.Discard, t.Body)
if err != nil {
return err
}
var nextra int64
nextra, err = io.Copy(ioutil.Discard, t.Body)
ncopy += nextra
}
if err != nil {