go/src
Brad Fitzpatrick ea2376fcea net/http: make Transport.RoundTrip return raw Conn.Read error on peek failure
From at least Go 1.4 to Go 1.6, Transport.RoundTrip would return the
error value from net.Conn.Read directly when the initial Read (1 byte
Peek) failed while reading the HTTP response, if a request was
outstanding. While never a documented or tested promise, Go 1.7 changed the
behavior (starting at https://golang.org/cl/23160).

This restores the old behavior and adds a test (but no documentation
promises yet) while keeping the fix for spammy logging reported in #15446.

This looks larger than it is: it just changes errServerClosedConn from
a variable to a type, where the type preserves the underlying
net.Conn.Read error, for unwrapping later in Transport.RoundTrip.

Fixes #16465

Change-Id: I6fa018991221e93c0cfe3e4129cb168fbd98bd27
Reviewed-on: https://go-review.googlesource.com/25153
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-07-26 05:28:06 +00:00
..
archive archive/zip: use HTTPS for documentation link 2016-05-14 17:27:44 +00:00
bufio all: use SeekStart, SeekCurrent, SeekEnd 2016-05-06 00:10:41 +00:00
builtin
bytes bytes: use Run method for benchmarks 2016-06-03 07:03:03 +00:00
cmd cmd/compile: change phi location to be optimistic at backedges 2016-07-21 16:09:45 +00:00
compress compress/flate: document HuffmanOnly 2016-07-25 23:20:40 +00:00
container all: fixed a handful of typos 2016-05-24 21:18:03 +00:00
context context: cancel the context in ExampleWithTimeout, with explanation 2016-06-30 19:56:02 +00:00
crypto crypto/ecdsa: Update documentation for Sign 2016-06-29 18:44:36 +00:00
database/sql database/sql: deflake TestPendingConnsAfterErr and fix races, panics 2016-06-28 21:37:53 +00:00
debug debug/pe: handle files with no string table 2016-06-19 05:18:09 +00:00
encoding encoding/xml: update docs to follow convention 2016-07-06 17:19:45 +00:00
errors
expvar expvar: slightly expand documentation for Var's String method 2016-05-19 04:20:47 +00:00
flag flag: recognize "0s" as the zero value for a flag.Duration 2016-05-31 23:45:47 +00:00
fmt fmt: properly handle early io.EOF Reads in readRune.readByte 2016-07-16 19:14:58 +00:00
go all: rename vendored golang.org/x/net packages to golang_org 2016-07-13 18:35:40 +00:00
hash hash/crc64: Use slicing by 8. 2016-05-18 14:38:04 +00:00
html html/template: update security model link 2016-06-23 04:30:07 +00:00
image image/gif: accept an out-of-bounds transparent color index. 2016-04-29 00:01:22 +00:00
index/suffixarray
internal internal/trace: err if binary is not supplied for old trace 2016-06-16 16:22:03 +00:00
io io: use SeekStart, SeekCurrent, and SeekEnd in io.Seeker documentation 2016-05-29 06:52:45 +00:00
log
math math/rand: fix raciness in Rand.Read 2016-07-11 15:11:44 +00:00
mime mime/multipart: sort header keys to ensure reproducible output 2016-05-16 22:55:16 +00:00
net net/http: make Transport.RoundTrip return raw Conn.Read error on peek failure 2016-07-26 05:28:06 +00:00
os os/exec: start checking for context cancelation in Start 2016-06-30 16:35:56 +00:00
path path/filepath: fix typo in comment 2016-07-07 02:59:09 +00:00
reflect reflect: an unnamed type has no PkgPath 2016-07-12 12:43:48 +00:00
regexp Revert "regexp: add the Fanout benchmark 2016-07-12 04:59:34 +00:00
runtime runtime: add explicit `INT $3` at end of Darwin amd64 sigtramp 2016-07-21 01:04:22 +00:00
sort
strconv strconv: clarify doc for Atoi return type 2016-06-28 18:16:25 +00:00
strings strings: fix and reenable amd64 Index for 17-31 byte strings 2016-05-27 22:57:32 +00:00
sync sync: document that RWMutex read locks may not be held recursively 2016-05-31 00:22:56 +00:00
syscall syscall: add another output for TestGroupCleanupUserNamespace 2016-07-08 19:40:59 +00:00
testing testing: document that logs are dumped to standard output 2016-06-23 04:31:19 +00:00
text text/template: clarify the default formatting used for values 2016-06-21 02:15:44 +00:00
time time: update documentation for Duration.String regarding the zero value 2016-06-24 19:41:45 +00:00
unicode unicode: upgrade to version 9.0.0 2016-06-28 15:08:11 +00:00
unsafe
vendor/golang_org/x/net all: rename vendored golang.org/x/net packages to golang_org 2016-07-13 18:35:40 +00:00
Make.dist
all.bash
all.bat
all.rc
androidtest.bash all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
bootstrap.bash all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash cmd/compile: switch to compact export format by default 2016-04-27 16:59:55 +00:00
iostest.bash
make.bash build: unset GOBIN during build 2016-05-19 18:40:53 +00:00
make.bat build: unset GOBIN during build 2016-05-19 18:40:53 +00:00
make.rc build: unset GOBIN during build 2016-05-19 18:40:53 +00:00
naclmake.bash
nacltest.bash all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
race.bash
race.bat
run.bash build: unset GOBIN during build 2016-05-19 18:40:53 +00:00
run.bat build: unset GOBIN during build 2016-05-19 18:40:53 +00:00
run.rc build: unset GOBIN during build 2016-05-19 18:40:53 +00:00