]> Cypherpunks repositories - gostls13.git/commitdiff
net/http/httptest: remove workaround on Plan 9
authorDavid du Colombier <0intro@gmail.com>
Sat, 12 Nov 2016 21:12:22 +0000 (22:12 +0100)
committerDavid du Colombier <0intro@gmail.com>
Sat, 12 Nov 2016 21:23:04 +0000 (21:23 +0000)
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 <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/net/http/httptest/server.go

index e67b7145bec488aea25ebdbdf44ea0414111667f..711821433bf22dd6ff47fbf581af80f074034517 100644 (file)
@@ -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{}{}