@@ -25,6 +25,8 @@ import (
2525//
2626// https://golang.org/pkg/net/http/#ResponseWriter
2727// https://golang.org/pkg/net/http/#example_ResponseWriter_trailers
28+ //
29+ // Deprecated: Use [http.TrailerPrefix] instead.
2830const TrailerPrefix = "Trailer:"
2931
3032// Push errors.
@@ -38,16 +40,22 @@ var (
3840// The configuration conf may be nil.
3941//
4042// ConfigureServer must be called before s begins serving.
43+ //
44+ // Deprecated: Set [http.Server.Protocols] instead.
4145func ConfigureServer (s * http.Server , conf * Server ) error {
4246 return configureServer (s , conf )
4347}
4448
4549// Server is an HTTP/2 server.
50+ //
51+ // Deprecated: Use [http.Server] instead.
4652type Server struct {
4753 // MaxHandlers limits the number of http.Handler ServeHTTP goroutines
4854 // which may run at a time over all connections.
4955 // Negative or zero no limit.
5056 // TODO: implement
57+ //
58+ // Deprecated: This field has never had any effect.
5159 MaxHandlers int
5260
5361 // MaxConcurrentStreams optionally specifies the number of
@@ -56,64 +64,96 @@ type Server struct {
5664 // which may be active globally, which is MaxHandlers.
5765 // If zero, MaxConcurrentStreams defaults to at least 100, per
5866 // the HTTP/2 spec's recommendations.
67+ //
68+ // Deprecated: Use [http.Server.HTTP2] and
69+ // [http.HTTP2Config.MaxConcurrentStreams] instead.
5970 MaxConcurrentStreams uint32
6071
6172 // MaxDecoderHeaderTableSize optionally specifies the http2
6273 // SETTINGS_HEADER_TABLE_SIZE to send in the initial settings frame. It
6374 // informs the remote endpoint of the maximum size of the header compression
6475 // table used to decode header blocks, in octets. If zero, the default value
6576 // of 4096 is used.
77+ //
78+ // Deprecated: Use [http.Server.HTTP2] and
79+ // [http.HTTP2Config.MaxDecoderHeaderTableSize] instead.
6680 MaxDecoderHeaderTableSize uint32
6781
6882 // MaxEncoderHeaderTableSize optionally specifies an upper limit for the
6983 // header compression table used for encoding request headers. Received
7084 // SETTINGS_HEADER_TABLE_SIZE settings are capped at this limit. If zero,
7185 // the default value of 4096 is used.
86+ //
87+ // Deprecated: Use [http.Server.HTTP2] and
88+ // [http.HTTP2Config.MaxEncoderHeaderTableSize] instead.
7289 MaxEncoderHeaderTableSize uint32
7390
7491 // MaxReadFrameSize optionally specifies the largest frame
7592 // this server is willing to read. A valid value is between
7693 // 16k and 16M, inclusive. If zero or otherwise invalid, a
7794 // default value is used.
95+ //
96+ // Deprecated: Use [http.Server.HTTP2] and
97+ // [http.HTTP2Config.MaxReadFrameSize] instead.
7898 MaxReadFrameSize uint32
7999
80100 // PermitProhibitedCipherSuites, if true, permits the use of
81101 // cipher suites prohibited by the HTTP/2 spec.
102+ //
103+ // Deprecated: Use [http.Server.HTTP2] and
104+ // [http.HTTP2Config.PermitProhibitedCipherSuites] instead.
82105 PermitProhibitedCipherSuites bool
83106
84107 // IdleTimeout specifies how long until idle clients should be
85108 // closed with a GOAWAY frame. PING frames are not considered
86109 // activity for the purposes of IdleTimeout.
87110 // If zero or negative, there is no timeout.
111+ //
112+ // Deprecated: Use [http.Server.IdleTimeout] instead.
88113 IdleTimeout time.Duration
89114
90115 // ReadIdleTimeout is the timeout after which a health check using a ping
91116 // frame will be carried out if no frame is received on the connection.
92117 // If zero, no health check is performed.
118+ //
119+ // Deprecated: Use [http.Server.HTTP2] and
120+ // [http.HTTP2Config.SendPingTimeout] instead.
93121 ReadIdleTimeout time.Duration
94122
95123 // PingTimeout is the timeout after which the connection will be closed
96124 // if a response to a ping is not received.
97125 // If zero, a default of 15 seconds is used.
126+ //
127+ // Deprecated: Use [http.Server.HTTP2] and
128+ // [http.HTTP2Config.PingTimeout] instead.
98129 PingTimeout time.Duration
99130
100131 // WriteByteTimeout is the timeout after which a connection will be
101132 // closed if no data can be written to it. The timeout begins when data is
102133 // available to write, and is extended whenever any bytes are written.
103134 // If zero or negative, there is no timeout.
135+ //
136+ // Deprecated: Use [http.Server.HTTP2] and
137+ // [http.HTTP2Config.WriteByteTimeout] instead.
104138 WriteByteTimeout time.Duration
105139
106140 // MaxUploadBufferPerConnection is the size of the initial flow
107141 // control window for each connections. The HTTP/2 spec does not
108142 // allow this to be smaller than 65535 or larger than 2^32-1.
109143 // If the value is outside this range, a default value will be
110144 // used instead.
145+ //
146+ // Deprecated: Use [http.Server.HTTP2] and
147+ // [http.HTTP2Config.MaxReceiveBufferPerConnection] instead.
111148 MaxUploadBufferPerConnection int32
112149
113150 // MaxUploadBufferPerStream is the size of the initial flow control
114151 // window for each stream. The HTTP/2 spec does not allow this to
115152 // be larger than 2^32-1. If the value is zero or larger than the
116153 // maximum, a default value will be used instead.
154+ //
155+ // Deprecated: Use [http.Server.HTTP2] and
156+ // [http.HTTP2Config.MaxReceiveBufferPerStream] instead.
117157 MaxUploadBufferPerStream int32
118158
119159 // NewWriteScheduler constructs a write scheduler for a connection.
@@ -126,6 +166,9 @@ type Server struct {
126166 // It's intended to increment a metric for monitoring, such
127167 // as an expvar or Prometheus metric.
128168 // The errType consists of only ASCII word characters.
169+ //
170+ // Deprecated: Use [http.Server.HTTP2] and
171+ // [http.HTTP2Config.CountError] instead.
129172 CountError func (errType string )
130173
131174 // Internal state. This is a pointer (rather than embedded directly)
@@ -135,6 +178,8 @@ type Server struct {
135178}
136179
137180// ServeConnOpts are options for the Server.ServeConn method.
181+ //
182+ // Deprecated: ServeConnOpts is deprecated.
138183type ServeConnOpts struct {
139184 // Context is the base context to use.
140185 // If nil, context.Background is used.
@@ -178,6 +223,8 @@ type ServeConnOpts struct {
178223// implemented in terms of providing a suitably-behaving net.Conn.
179224//
180225// The opts parameter is optional. If nil, default values are used.
226+ //
227+ // Deprecated: Use [http.Server.Serve] or [http.Server.ServeTLS] instead.
181228func (s * Server ) ServeConn (c net.Conn , opts * ServeConnOpts ) {
182229 if opts == nil {
183230 opts = & ServeConnOpts {}
0 commit comments