aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/clientserver_test.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2016-02-01 22:16:42 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2016-02-01 23:05:46 +0000
commit125f52dfa8ce6df0380b0bdc66effb8afd697bda (patch)
treec2769cc5f80b318b9a46e34edf3186433db592fe /src/net/http/clientserver_test.go
parentb3c05f08a97ac89064d3edbf4efb7bea671c2c18 (diff)
downloadgo-125f52dfa8ce6df0380b0bdc66effb8afd697bda.tar.xz
net/http: update bundled http2, fix Transport memory leak
Updates x/net/http2 to git rev 644ffc for three CLs since the last update: http2: don't add *Response to activeRes in Transport on Headers.END_STREAM https://golang.org/cl/19134 http2: add mechanism to send undeclared Trailers mid handler https://golang.org/cl/19131 http2: remove unused variable https://golang.org/cl/18936 The first in the list above is the main fix that's necessary. The other are two are in the git history but along for the cmd/bundle ride. The middle CL is well-tested, small (mostly comments), non-tricky, and almost never seen (since nobody really uses Trailers). The final CL is just deleting an unused global variable. Fixes #14084 again (with more tests) Change-Id: Iac51350acee9c51d32bf7779d57e9d5a5482b928 Reviewed-on: https://go-review.googlesource.com/19135 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org>
Diffstat (limited to 'src/net/http/clientserver_test.go')
-rw-r--r--src/net/http/clientserver_test.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/net/http/clientserver_test.go b/src/net/http/clientserver_test.go
index 9b581e7311..fbaa805712 100644
--- a/src/net/http/clientserver_test.go
+++ b/src/net/http/clientserver_test.go
@@ -1001,13 +1001,17 @@ func TestTransportDiscardsUnneededConns(t *testing.T) {
}
// tests that Transport doesn't retain a pointer to the provided request.
-func TestTransportGCRequest_h1(t *testing.T) { testTransportGCRequest(t, h1Mode) }
-func TestTransportGCRequest_h2(t *testing.T) { testTransportGCRequest(t, h2Mode) }
-func testTransportGCRequest(t *testing.T, h2 bool) {
+func TestTransportGCRequest_Body_h1(t *testing.T) { testTransportGCRequest(t, h1Mode, true) }
+func TestTransportGCRequest_Body_h2(t *testing.T) { testTransportGCRequest(t, h2Mode, true) }
+func TestTransportGCRequest_NoBody_h1(t *testing.T) { testTransportGCRequest(t, h1Mode, false) }
+func TestTransportGCRequest_NoBody_h2(t *testing.T) { testTransportGCRequest(t, h2Mode, false) }
+func testTransportGCRequest(t *testing.T, h2, body bool) {
defer afterTest(t)
cst := newClientServerTest(t, h2, HandlerFunc(func(w ResponseWriter, r *Request) {
ioutil.ReadAll(r.Body)
- io.WriteString(w, "Hello.")
+ if body {
+ io.WriteString(w, "Hello.")
+ }
}))
defer cst.close()