@@ -345,6 +345,63 @@ func (t *Transport) SetMaxResponseHeaderBytes(max int64) *Transport {
345
345
return t
346
346
}
347
347
348
+ // SetHTTP2MaxHeaderListSize set the http2 MaxHeaderListSize,
349
+ // which is the http2 SETTINGS_MAX_HEADER_LIST_SIZE to
350
+ // send in the initial settings frame. It is how many bytes
351
+ // of response headers are allowed. Unlike the http2 spec, zero here
352
+ // means to use a default limit (currently 10MB). If you actually
353
+ // want to advertise an unlimited value to the peer, Transport
354
+ // interprets the highest possible value here (0xffffffff or 1<<32-1)
355
+ // to mean no limit.
356
+ func (t * Transport ) SetHTTP2MaxHeaderListSize (max uint32 ) * Transport {
357
+ t .t2 .MaxHeaderListSize = max
358
+ return t
359
+ }
360
+
361
+ // SetHTTP2StrictMaxConcurrentStreams set the http2
362
+ // StrictMaxConcurrentStreams, which controls whether the
363
+ // server's SETTINGS_MAX_CONCURRENT_STREAMS should be respected
364
+ // globally. If false, new TCP connections are created to the
365
+ // server as needed to keep each under the per-connection
366
+ // SETTINGS_MAX_CONCURRENT_STREAMS limit. If true, the
367
+ // server's SETTINGS_MAX_CONCURRENT_STREAMS is interpreted as
368
+ // a global limit and callers of RoundTrip block when needed,
369
+ // waiting for their turn.
370
+ func (t * Transport ) SetHTTP2StrictMaxConcurrentStreams (strict bool ) * Transport {
371
+ t .t2 .StrictMaxConcurrentStreams = strict
372
+ return t
373
+ }
374
+
375
+ // SetHTTP2ReadIdleTimeout set the http2 ReadIdleTimeout,
376
+ // which is the timeout after which a health check using ping
377
+ // frame will be carried out if no frame is received on the connection.
378
+ // Note that a ping response will is considered a received frame, so if
379
+ // there is no other traffic on the connection, the health check will
380
+ // be performed every ReadIdleTimeout interval.
381
+ // If zero, no health check is performed.
382
+ func (t * Transport ) SetHTTP2ReadIdleTimeout (timeout time.Duration ) * Transport {
383
+ t .t2 .ReadIdleTimeout = timeout
384
+ return t
385
+ }
386
+
387
+ // SetHTTP2PingTimeout set the http2 PingTimeout, which is the timeout
388
+ // after which the connection will be closed if a response to Ping is
389
+ // not received.
390
+ // Defaults to 15s
391
+ func (t * Transport ) SetHTTP2PingTimeout (timeout time.Duration ) * Transport {
392
+ t .t2 .PingTimeout = timeout
393
+ return t
394
+ }
395
+
396
+ // SetHTTP2WriteByteTimeout set the http2 WriteByteTimeout, which is the
397
+ // timeout after which the connection will be closed no data can be written
398
+ // to it. The timeout begins when data is available to write, and is
399
+ // extended whenever any bytes are written.
400
+ func (t * Transport ) SetHTTP2WriteByteTimeout (timeout time.Duration ) * Transport {
401
+ t .t2 .WriteByteTimeout = timeout
402
+ return t
403
+ }
404
+
348
405
// SetTLSClientConfig set the custom TLSClientConfig, which specifies the TLS configuration to
349
406
// use with tls.Client.
350
407
// If nil, the default configuration is used.
0 commit comments