зеркало из https://github.com/golang/net.git
62685c2d7c
This old code was buggy: type gzipReader struct { body io.ReadCloser // underlying Response.Body zr io.Reader // lazily-initialized gzip reader } func (gz *gzipReader) Read(p []byte) (n int, err error) { if gz.zr == nil { gz.zr, err = gzip.NewReader(gz.body) if err != nil { return 0, err } } return gz.zr.Read(p) } If a Read on a gzipped Response.Body (of type *http2.gzipReader) resulted in gzip.NewReader returning an error, gzipReader assigned a *gzip.Reader-typed nil value to the gz.zr interface value. On a subsequent Read, gz.zr would not be equal to ==, because it was actually equal to (type *gzip.Reader, nil), and then zr.Read would call (*gzip.Reader).Read with a nil receiver and explode. Debugged internally. (http://go/http2gzipbug) Change-Id: Icba040ace8ffac3536e5e7ade6695c7660838ca1 |
||
---|---|---|
context | ||
dict | ||
html | ||
http2 | ||
icmp | ||
idna | ||
internal | ||
ipv4 | ||
ipv6 | ||
netutil | ||
proxy | ||
publicsuffix | ||
trace | ||
webdav | ||
websocket | ||
xsrftoken | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
LICENSE | ||
PATENTS | ||
README | ||
codereview.cfg |
README
This repository holds supplementary Go networking libraries. To submit changes to this repository, see http://golang.org/doc/contribute.html.