Commit Graph

7 Commits

Author SHA1 Message Date
Brad Fitzpatrick
548f7bf20c http2: add disabled start of tests for trailers, clean up, deflake some tests
Sort response headers too, so we have consistent output.

Change-Id: I0ce925a8257a8e218a27b7d9b3fa9c96f71fba90
Reviewed-on: https://go-review.googlesource.com/17828
Reviewed-by: Blake Mizerany <blake.mizerany@gmail.com>
2015-12-15 23:48:57 +00:00
Brad Fitzpatrick
74bd44bb05 http2: catch panics server-side, respect RST_STREAM on the Transport side
Tests in https://go-review.googlesource.com/#/c/17683/5/src/net/http/serve_test.go:
TestHandlerPanicNil_h2 and TestHandlerPanic_h2, to be re-enabled
after the copy to the main repo.

Updates golang/go#13555 (fixes the bug after the copy to the main repo)

Change-Id: I7aa3e55fb21b576ea4f94c7ed41d1ebd750ef951
Reviewed-on: https://go-review.googlesource.com/17823
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-12-15 04:47:36 +00:00
Brad Fitzpatrick
c745c36eab http2: client & server fixes
Fixes found in the process of adding more A/B tests to net/http,
comparing HTTP/1 and HTTP/2 behaviors.

Most of the new tests are in Gerrit change Id9c45fad44cdf70ac9
in the "go" repo.

Fixes golang/go#13315
Fixes golang/go#13316
Fixes golang/go#13317
Fixes other stuff found in the process too
Updates golang/go#6891 (http2 support in general)

Change-Id: I83b5bfb471047312c0dcb0a0b21d709008f34136
Reviewed-on: https://go-review.googlesource.com/17204
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-11-25 04:57:44 +00:00
Brad Fitzpatrick
564010564f http2: fix server race
This changes makes sure we never write to *writeData in the ServeHTTP
goroutine until the serve goroutine is done with it.

Also, it makes sure we don't transition the stream to the closed state
on the final DATA frame concurrently with the write.

To fix both, the writeFrameAsync goroutine no longer replies directly back
to the ServeHTTP goroutine with the write result. It's now passed to
the serve goroutine instead, which looks at the frameWriteMsg to
decide how to advance the state machine, then signals the ServeHTTP
goroutine with the result, and then advances the state machine.

Because advancing the state machine could transition it to closed,
which the ServeHTTP goroutine might also be selecting on, make the
ServeHTTP goroutine prefer its frameWriteMsg response channel for errors
over the stream closure in its select.

Various code simplifications and robustness in the process.

Tests now pass reliably even with high -count values, -race on/off,
etc. I've been unable to make h2load be unhappy now either.

Thanks to Tatsuhiro Tsujikawa (Github user @tatsuhiro-t) for the bug
report and debugging clues.

Fixes golang/go#12998

Change-Id: I441c4c9ca928eaba89fd4728d213019606edd899
Reviewed-on: https://go-review.googlesource.com/16063
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-10-20 23:04:06 +00:00
Andrew Gerrand
6d10a0c3ea http2: update copyright headers
Change-Id: I043b392053bdf61ef863dfcb083ff6034d9322e7
Reviewed-on: https://go-review.googlesource.com/15840
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-10-14 04:32:53 +00:00
Brad Fitzpatrick
ae54c55587 http2: rewrite github.com/bradfitz/http2 references to their new paths 2015-09-24 09:24:43 +02:00
Brad Fitzpatrick
17e723d022 http2: move github.com/bradfitz/http2 down into a new http2 directory
In prep for move to golang.org/x/net/*.
2015-09-24 09:24:40 +02:00