diff options
| author | Brad Fitzpatrick <bradfitz@golang.org> | 2018-07-09 23:47:02 +0000 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2018-07-10 00:45:46 +0000 |
| commit | c793ea37195f982bbe0b78f90fa0392bb856e834 (patch) | |
| tree | 37a4de4e975aa4043b63393b38a63fc37199e8ce /src/net/http/server.go | |
| parent | 194bbe84cbb2fa970a22b70b1e5d715c82334dfb (diff) | |
| download | go-c793ea37195f982bbe0b78f90fa0392bb856e834.tar.xz | |
net/http: remove dead code noted in post-submit review of CL 81778
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>
Diffstat (limited to 'src/net/http/server.go')
| -rw-r--r-- | src/net/http/server.go | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/net/http/server.go b/src/net/http/server.go index 85aa4935a9..f9237d7d71 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -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{}) { |
