]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: remove dead code noted in post-submit review of CL 81778
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 9 Jul 2018 23:47:02 +0000 (23:47 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 10 Jul 2018 00:45:46 +0000 (00:45 +0000)
Per comments in https://github.com/golang/go/issues/20239#issuecomment-402199944

Updates #20239
Updates #26303

Change-Id: Iddf34c0452bd30ca9111b951bca48d1e011bd85a
Reviewed-on: https://go-review.googlesource.com/122820
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/http/server.go

index 85aa4935a9ddf1433fc64fc59103bc306909cf22..f9237d7d71f22fe6687129ed758fc3c5d088ff12 100644 (file)
@@ -2806,9 +2806,6 @@ func (srv *Server) Serve(l net.Listener) error {
                return err
        }
 
-       serveDone := make(chan struct{})
-       defer close(serveDone)
-
        if !srv.trackListener(&l, true) {
                return ErrServerClosed
        }
@@ -2910,11 +2907,6 @@ func (s *Server) trackListener(ln *net.Listener, add bool) bool {
                if s.shuttingDown() {
                        return false
                }
-               // If the *Server is being reused after a previous
-               // Close or Shutdown, reset its doneChan:
-               if len(s.listeners) == 0 && len(s.activeConn) == 0 {
-                       s.doneChan = nil
-               }
                s.listeners[ln] = struct{}{}
        } else {
                delete(s.listeners, ln)
@@ -2973,14 +2965,7 @@ func (srv *Server) SetKeepAlivesEnabled(v bool) {
        // Close idle HTTP/1 conns:
        srv.closeIdleConns()
 
-       // Close HTTP/2 conns, as soon as they become idle, but reset
-       // the chan so future conns (if the listener is still active)
-       // still work and don't get a GOAWAY immediately, before their
-       // first request:
-       srv.mu.Lock()
-       defer srv.mu.Unlock()
-       srv.closeDoneChanLocked() // closes http2 conns
-       srv.doneChan = nil
+       // TODO: Issue 26303: close HTTP/2 conns as soon as they become idle.
 }
 
 func (s *Server) logf(format string, args ...interface{}) {