aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/export_test.go
diff options
context:
space:
mode:
authorCharlie Getzen <charlie@bolt.com>2021-11-05 17:27:35 +0000
committerDamien Neil <dneil@google.com>2021-11-05 21:18:28 +0000
commit4c7cafdd03426bc2b9fb1275d13d0abc755dde16 (patch)
tree0c7c1070022a37cc86e0c3bd3ce3230ea246eef8 /src/net/http/export_test.go
parent091948a55fb198be4202c21a5809ec68d77f70c4 (diff)
downloadgo-4c7cafdd03426bc2b9fb1275d13d0abc755dde16.tar.xz
net/http: distinguish between timeouts and client hangups in TimeoutHandler
Fixes #48948 Change-Id: I411e3be99c7979ae289fd937388aae63d81adb59 GitHub-Last-Rev: 14abd7e4d774ed5ef63aa0a69e80fbc8b5a5af26 GitHub-Pull-Request: golang/go#48993 Reviewed-on: https://go-review.googlesource.com/c/go/+/356009 Reviewed-by: Damien Neil <dneil@google.com> Trust: Damien Neil <dneil@google.com> Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/net/http/export_test.go')
-rw-r--r--src/net/http/export_test.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/net/http/export_test.go b/src/net/http/export_test.go
index 096a6d382a..a849327f45 100644
--- a/src/net/http/export_test.go
+++ b/src/net/http/export_test.go
@@ -88,12 +88,7 @@ func SetPendingDialHooks(before, after func()) {
func SetTestHookServerServe(fn func(*Server, net.Listener)) { testHookServerServe = fn }
-func NewTestTimeoutHandler(handler Handler, ch <-chan time.Time) Handler {
- ctx, cancel := context.WithCancel(context.Background())
- go func() {
- <-ch
- cancel()
- }()
+func NewTestTimeoutHandler(handler Handler, ctx context.Context) Handler {
return &timeoutHandler{
handler: handler,
testContext: ctx,