From e776975ae61e8db6ff5db33b039513c9d8524794 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Sat, 31 Dec 2016 18:35:15 +0000 Subject: [PATCH] net/http: update bundled http2 for Server WriteTimeout change Updates http2 to x/net/http2 git rev 8fd7f25 for: http2: clear WriteTimeout in Server https://golang.org/cl/34724 And un-skip the new test. (The new test is a slow test, anyway, so won't affect builders or all.bash, but I verified it now passes.) Updates #18437 Change-Id: Ia91ae702edfd23747a9d6b61da284a5a957bfed3 Reviewed-on: https://go-review.googlesource.com/34729 Run-TryBot: Brad Fitzpatrick Reviewed-by: Joe Tsai Reviewed-by: Kale B TryBot-Result: Gobot Gobot --- src/net/http/h2_bundle.go | 4 ++++ src/net/http/serve_test.go | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go index 2e0b3c905acf9..4536b2ff5deb1 100644 --- a/src/net/http/h2_bundle.go +++ b/src/net/http/h2_bundle.go @@ -3141,6 +3141,10 @@ func (s *http2Server) ServeConn(c net.Conn, opts *http2ServeConnOpts) { pushEnabled: true, } + if sc.hs.WriteTimeout != 0 { + sc.conn.SetWriteDeadline(time.Time{}) + } + if s.NewWriteScheduler != nil { sc.writeSched = s.NewWriteScheduler() } else { diff --git a/src/net/http/serve_test.go b/src/net/http/serve_test.go index 17cfde7e7a538..d8561f7c7f0d0 100644 --- a/src/net/http/serve_test.go +++ b/src/net/http/serve_test.go @@ -537,7 +537,6 @@ func TestServerTimeouts(t *testing.T) { // Test that the HTTP/2 server handles Server.WriteTimeout (Issue 18437) func TestHTTP2WriteDeadlineExtendedOnNewRequest(t *testing.T) { - t.Skip("disabled until Issue 18437 is fixed") if testing.Short() { t.Skip("skipping in short mode") }