mirror of
https://github.com/golang/net.git
synced 2026-03-31 10:27:08 +09:00
As part of adding support for HTTP/2 stream prioritization, a DisableClientPriority field will be added to http.Server to allow users to completely disable client prioritization if desired. When DisableClientPriority is set to true, HTTP/2 server will revert back to the old behavior where streams are processed in a round-robin manner. For golang/go#75500 Change-Id: Ida083b3ac17a953e5ddb3ad7ab8a81f9cde2bfc1 Reviewed-on: https://go-review.googlesource.com/c/net/+/737521 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Nicholas Husin <husin@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
21 lines
705 B
Go
21 lines
705 B
Go
// Copyright 2026 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
//go:build !go1.27
|
|
|
|
package http2
|
|
|
|
import "net/http"
|
|
|
|
// Support for go.dev/issue/75500 is added in Go 1.27. In case anyone uses
|
|
// x/net with versions before Go 1.27, we return true here so that their write
|
|
// scheduler will still be the round-robin write scheduler rather than the RFC
|
|
// 9218 write scheduler. That way, older users of Go will not see a sudden
|
|
// change of behavior just from importing x/net.
|
|
//
|
|
// TODO(nsh): remove this file after x/net go.mod is at Go 1.27.
|
|
func clientPriorityDisabled(_ *http.Server) bool {
|
|
return true
|
|
}
|