1
0
mirror of https://github.com/golang/go synced 2024-09-24 13:20:12 -06:00

net/http: fix bug in error checking

Thanks to josef86@gmail.com for pointing this out.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5477092
This commit is contained in:
Robert Griesemer 2011-12-14 08:43:42 -08:00
parent e14d1d7e41
commit c0421d92c8

View File

@ -544,7 +544,7 @@ func (pc *persistConn) readLoop() {
resp.Header.Del("Content-Length")
resp.ContentLength = -1
gzReader, zerr := gzip.NewReader(resp.Body)
if err != nil {
if zerr != nil {
pc.close()
err = zerr
} else {