• Brad Fitzpatrick's avatar
    http2: in Server, disarm connection's ReadTimeout after first request · 69729301
    Brad Fitzpatrick authored
    Fix a regression from Go 1.5 to Go 1.6: when we introduced automatic
    HTTP/2 support in Go 1.6, we never handled Server.ReadTimeout. If a
    user set ReadTimeout, the net/http package would set the read deadline
    on the connection during the TLS handshake, but then the http2 package
    would never disarm it, killing the likely-still-in-use connection
    after the timeout period.
    
    This CL changes it to disarm the timeout after the first request
    headers, similar to net/http.Server.
    
    Unlike net/http.Server, we don't re-arm it on each idle period,
    because the definition of idle is more complicated with HTTP/2.
    
    No tests here for now. Tests will be in the go repo once all the knobs
    are in place and this is re-bundled into std, testing both http1 and
    http2.
    
    Updates golang/go#16450 (minimal fix for now)
    Updates golang/go#14204 (considering a new http1+http2 IdleTimeout knob)
    
    Change-Id: Iaa1570c118efda7dc0a65ba84cd77885699ec8fc
    Reviewed-on: https://go-review.googlesource.com/30077Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    69729301
Name
Last commit
Last update
bpf Loading commit data...
context Loading commit data...
dict Loading commit data...
html Loading commit data...
http2 Loading commit data...
icmp Loading commit data...
idna Loading commit data...
internal Loading commit data...
ipv4 Loading commit data...
ipv6 Loading commit data...
lex/httplex Loading commit data...
lif Loading commit data...
netutil Loading commit data...
proxy Loading commit data...
publicsuffix Loading commit data...
route Loading commit data...
trace Loading commit data...
webdav Loading commit data...
websocket Loading commit data...
xsrftoken Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
codereview.cfg Loading commit data...