From 8f36668178d07e6f1b979252c1c68ebe788d14be Mon Sep 17 00:00:00 2001 From: Tom Bergan Date: Thu, 11 May 2017 10:13:10 -0700 Subject: [PATCH] net/http: for http2, use the priority write scheduler by default Updates #18318 Change-Id: Ibd4ebc7708abf87eded8da9661378b5777b8a400 Reviewed-on: https://go-review.googlesource.com/43231 Run-TryBot: Tom Bergan TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/net/http/server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/net/http/server.go b/src/net/http/server.go index 838b95aaeda..45f8e1b16a2 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -2920,7 +2920,10 @@ func (srv *Server) onceSetNextProtoDefaults() { // Enable HTTP/2 by default if the user hasn't otherwise // configured their TLSNextProto map. if srv.TLSNextProto == nil { - srv.nextProtoErr = http2ConfigureServer(srv, nil) + conf := &http2Server{ + NewWriteScheduler: func() http2WriteScheduler { return http2NewPriorityWriteScheduler(nil) }, + } + srv.nextProtoErr = http2ConfigureServer(srv, conf) } }