From: David du Colombier <0intro@gmail.com> Date: Sat, 12 Nov 2016 21:12:22 +0000 (+0100) Subject: net/http/httptest: remove workaround on Plan 9 X-Git-Tag: go1.8beta1~177 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4bee9012b31a762799ea861cd5f55583f1f602f5;p=gostls13.git net/http/httptest: remove workaround on Plan 9 This issue has been fixed in CL 31390. Change-Id: I0c2425fd33be878037d10d612a50116a7b693431 Reviewed-on: https://go-review.googlesource.com/33195 Run-TryBot: David du Colombier <0intro@gmail.com> Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/net/http/httptest/server.go b/src/net/http/httptest/server.go index e67b7145be..711821433b 100644 --- a/src/net/http/httptest/server.go +++ b/src/net/http/httptest/server.go @@ -16,7 +16,6 @@ import ( "net/http" "net/http/internal" "os" - "runtime" "sync" "time" ) @@ -294,15 +293,6 @@ func (s *Server) closeConn(c net.Conn) { s.closeConnChan(c, nil) } // closeConnChan is like closeConn, but takes an optional channel to receive a value // when the goroutine closing c is done. func (s *Server) closeConnChan(c net.Conn, done chan<- struct{}) { - if runtime.GOOS == "plan9" { - // Go's Plan 9 net package isn't great at unblocking reads when - // their underlying TCP connections are closed. Don't trust - // that that the ConnState state machine will get to - // StateClosed. Instead, just go there directly. Plan 9 may leak - // resources if the syscall doesn't end up returning. Oh well. - s.forgetConn(c) - } - c.Close() if done != nil { done <- struct{}{}