aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/http.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2019-11-04 04:00:29 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2019-11-04 23:16:09 +0000
commit2566e21f243387156e8e7f2acad0ce14d9712bbc (patch)
treeafd805ec93137c876a6080b055e244ee14487ade /src/net/http/http.go
parent74af7fc6038aff15e3c9a7bf5791103e96952b3c (diff)
downloadgo-2566e21f243387156e8e7f2acad0ce14d9712bbc.tar.xz
net/http: support disabling built-in HTTP/2 with a new build tag
Fixes #35082 Updates #6853 Change-Id: I4eeb0e15f534cff57fefb6039cd33fadf15b946e Reviewed-on: https://go-review.googlesource.com/c/go/+/205139 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: David Crawshaw <crawshaw@golang.org>
Diffstat (limited to 'src/net/http/http.go')
-rw-r--r--src/net/http/http.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/net/http/http.go b/src/net/http/http.go
index 3510fe604d..89e86d80e8 100644
--- a/src/net/http/http.go
+++ b/src/net/http/http.go
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:generate bundle -o=h2_bundle.go -prefix=http2 -tags=!nethttpomithttp2 golang.org/x/net/http2
+
package http
import (
@@ -22,6 +24,11 @@ const maxInt64 = 1<<63 - 1
// immediate cancellation of network operations.
var aLongTimeAgo = time.Unix(1, 0)
+// omitBundledHTTP2 is set by omithttp2.go when the nethttpomithttp2
+// build tag is set. That means h2_bundle.go isn't compiled in and we
+// shouldn't try to use it.
+var omitBundledHTTP2 bool
+
// TODO(bradfitz): move common stuff here. The other files have accumulated
// generic http stuff in random places.