FAQ
Reviewers: golang-dev_googlegroups.com,

Message:
Hello golang-dev@googlegroups.com,

I'd like you to review this change to
https://go.googlecode.com/hg/


Description:
net/http/httptest: protect against port reuse

Should make BSDs more reliable. (they seem to reuse ports
quicker than Linux)

Tested by hand with local modifications to force reuse on
Linux. (net/http tests failed before, pass now) Details in the
issue.

Fixes issue 4436

Please review this at http://codereview.appspot.com/6847101/

Affected files:
M src/pkg/net/http/httptest/server.go


Index: src/pkg/net/http/httptest/server.go
===================================================================
--- a/src/pkg/net/http/httptest/server.go
+++ b/src/pkg/net/http/httptest/server.go
@@ -155,6 +155,10 @@
func (s *Server) Close() {
s.Listener.Close()
s.wg.Wait()
+ s.CloseClientConnections()
+ if t, ok := http.DefaultTransport.(*http.Transport); ok {
+ t.CloseIdleConnections()
+ }
}

// CloseClientConnections closes any currently open HTTP connections

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedNov 25, '12 at 7:57p
activeNov 25, '12 at 11:23p
posts5
users2
websitegolang.org

2 users in discussion

Bradfitz: 3 posts Minux: 2 posts

People

Translate

site design / logo © 2022 Grokbase