• Brad Fitzpatrick's avatar
    http2: revert Transport's strict interpretation of MAX_CONCURRENT_STREAMS · 351d144f
    Brad Fitzpatrick authored
    And add the http2.Transport.StrictMaxConcurrentStreams bool knob to
    behavior being reverted.
    
    In CL 53250 for golang/go#13774 (for Go 1.10) we changed the HTTP/2
    Transport's policy such that a server's advertisement of a
    MAX_CONCURRENT_STREAMS value meant that it was a maximum for the
    entire process, instead of just a single connection.
    
    We thought that was a reasonable interpretation of the spec and
    provided nice safety against slamming a server from a bunch of
    goroutines doing concurrent requests, but it's been largely
    unpopular (see golang/go#27044). It's also different behavior from
    HTTP/1 and because you're usually not sure which protocol version
    you're going to get, you need to limit your outbound HTTP requests
    anyway in case you're hitting an HTTP/1 server.
    
    And nowadays we have the Go 1.11 Transport.MaxConnsPerHost knob too
    (CL 71272 for golang/go#13957). It doesn't yet work for HTTP/2, but it
    will in either Go 1.12 or Go 1.13 (golang/go#27753)
    
    After this is bundled into net/http's, the default HTTP client will
    have this knob set false, restoring the old Go 1.9 behavior where new
    TCP connections are created as necessary. Users wanting the strict
    behavior and import golang.org/x/net/http2 themselves and make a
    Transport with StrictMaxConcurrentStreams set to true. Or they can set
    Transport.MaxConnsPerHost, once that works for HTTP/2.
    
    Updates golang/go#27044 (fixes after bundle into std)
    
    Change-Id: I4efdad7698feaf674ee8e01032d2dfa5c2f8a3a8
    Reviewed-on: https://go-review.googlesource.com/c/151857Reviewed-by: 's avatarAndrew Bonventre <andybons@golang.org>
    351d144f
Name
Last commit
Last update
..
h2c Loading commit data...
h2demo Loading commit data...
h2i Loading commit data...
hpack Loading commit data...
testdata Loading commit data...
.gitignore Loading commit data...
Dockerfile Loading commit data...
Makefile Loading commit data...
README Loading commit data...
ciphers.go Loading commit data...
ciphers_test.go Loading commit data...
client_conn_pool.go Loading commit data...
databuffer.go Loading commit data...
databuffer_test.go Loading commit data...
errors.go Loading commit data...
errors_test.go Loading commit data...
flow.go Loading commit data...
flow_test.go Loading commit data...
frame.go Loading commit data...
frame_test.go Loading commit data...
go111.go Loading commit data...
gotrack.go Loading commit data...
gotrack_test.go Loading commit data...
headermap.go Loading commit data...
http2.go Loading commit data...
http2_test.go Loading commit data...
not_go111.go Loading commit data...
pipe.go Loading commit data...
pipe_test.go Loading commit data...
server.go Loading commit data...
server_push_test.go Loading commit data...
server_test.go Loading commit data...
transport.go Loading commit data...
transport_test.go Loading commit data...
write.go Loading commit data...
writesched.go Loading commit data...
writesched_priority.go Loading commit data...
writesched_priority_test.go Loading commit data...
writesched_random.go Loading commit data...
writesched_random_test.go Loading commit data...
writesched_test.go Loading commit data...
z_spec_test.go Loading commit data...