]> Cypherpunks repositories - gostls13.git/commit
net/http/httptest: change Server to use http.Server.ConnState for accounting
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 29 Sep 2015 21:26:48 +0000 (14:26 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 20 Oct 2015 00:07:19 +0000 (00:07 +0000)
commita3156aaa121446c4136927f8c2139fefe05ba82c
tree57978013c11939273019a3fd43c51e3f6f52bdec
parent684218e1353251d0b223c171c1977a4af193383d
net/http/httptest: change Server to use http.Server.ConnState for accounting

With this CL, httptest.Server now uses connection-level accounting of
outstanding requests instead of ServeHTTP-level accounting. This is
more robust and results in a non-racy shutdown.

This is much easier now that net/http.Server has the ConnState hook.

Fixes #12789
Fixes #12781

Change-Id: I098cf334a6494316acb66cd07df90766df41764b
Reviewed-on: https://go-review.googlesource.com/15151
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/http/httptest/server.go
src/net/http/httptest/server_test.go