]> Cypherpunks repositories - gostls13.git/commit
net/http: add onClose hook to fake net listener
authorDamien Neil <dneil@google.com>
Mon, 17 Mar 2025 22:43:47 +0000 (15:43 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 18 Mar 2025 17:52:10 +0000 (10:52 -0700)
commita17c092c2c5e8ad45482ebbb9e17ef7f92edb96c
tree19f19a2c60a57342401c3e7a39f5f333561f9ccc
parent5916bc5b5796e8fd15f3b4e95c945f5f4933e1d5
net/http: add onClose hook to fake net listener

Avoids a race condition: If we set an onClose hook on a conn
created by a listener, then setting the hook can race with
the connection closing.

Change-Id: Ibadead3abbe4335d41f1e2cf84f4696fe98166b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/658655
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
src/net/http/netconn_test.go
src/net/http/transport_test.go