diff options
| author | Damien Neil <dneil@google.com> | 2025-11-19 11:25:49 -0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-11-20 10:14:05 -0800 |
| commit | a49b0302d0e1d97b67a5f3f3beceafdcbc4c2ef0 (patch) | |
| tree | 6f6e16d0648f1fbaada0a601fa0eec7c25dcde21 | |
| parent | 32f5aadd2ffc60421c62b185fa7668012fb5e73e (diff) | |
| download | go-a49b0302d0e1d97b67a5f3f3beceafdcbc4c2ef0.tar.xz | |
net/http: correctly close fake net.Conns
Fix an inverted test in fakeNetConn.Close that caused closing
a connection to not break the other half of the connection.
Change-Id: I4e53f78402f8e503c749d57f294a4524abdccfb5
Reviewed-on: https://go-review.googlesource.com/c/go/+/722220
Reviewed-by: Nicholas Husin <nsh@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
| -rw-r--r-- | src/net/http/netconn_test.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net/http/netconn_test.go b/src/net/http/netconn_test.go index 52b8069f8b..c5fd61289f 100644 --- a/src/net/http/netconn_test.go +++ b/src/net/http/netconn_test.go @@ -180,9 +180,10 @@ func (c *fakeNetConn) Close() error { c.loc.unlock() // Remote half of the connection reads EOF after reading any remaining data. c.rem.lock() - if c.rem.readErr != nil { + if c.rem.readErr == nil { c.rem.readErr = io.EOF } + c.rem.writeErr = net.ErrClosed c.rem.unlock() if c.autoWait { synctest.Wait() |
