mirror of
https://github.com/golang/go
synced 2024-11-20 03:04:40 -07:00
ce8341554c
Previously the HTTP client's (*Response).Body.Close would try to keep reading until EOF, hoping to reuse the keep-alive HTTP connection, but the EOF might never come, or it might take a long time. Now we immediately close the TCP connection if we haven't seen EOF. This shifts the burden onto clients to read their whole response bodies if they want the advantage of reusing TCP connections. In the future maybe we could decide on heuristics to read some number of bytes for some max amount of time before forcefully closing, but I'd rather not for now. Statistically, touching this code makes things regress, so I wouldn't be surprised if this introduces new bugs, but all the tests pass, and I think the code is simpler now too. Maybe. Please test your HTTP client code before Go 1.1. Fixes #3672 R=golang-dev, adg CC=golang-dev https://golang.org/cl/7419050 |
||
---|---|---|
.. | ||
cmd | ||
lib9 | ||
libbio | ||
libmach | ||
pkg | ||
all.bash | ||
all.bat | ||
all.rc | ||
clean.bash | ||
clean.bat | ||
clean.rc | ||
make.bash | ||
make.bat | ||
Make.dist | ||
make.rc | ||
race.bash | ||
race.bat | ||
run.bash | ||
run.bat | ||
run.rc | ||
sudo.bash |