Files
golang.net/http2
Brad Fitzpatrick 62685c2d7c http2: fix crash in Transport on double Read of invalid gzip Response.Body
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
2016-02-13 02:03:29 +00:00
..
2015-12-14 23:04:49 +00:00
2016-02-03 16:58:05 +00:00
2015-12-14 23:04:49 +00:00
2016-02-03 16:58:05 +00:00
2016-02-03 16:58:05 +00:00

This is a work-in-progress HTTP/2 implementation for Go.

It will eventually live in the Go standard library and won't require
any changes to your code to use.  It will just be automatic.

Status:

* The server support is pretty good. A few things are missing
  but are being worked on.
* The client work has just started but shares a lot of code
  is coming along much quicker.

Docs are at https://godoc.org/golang.org/x/net/http2

Demo test server at https://http2.golang.org/

Help & bug reports welcome!

Contributing: https://golang.org/doc/contribute.html
Bugs:         https://golang.org/issue/new?title=x/net/http2:+