Commit c793ea37 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

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: default avatarIan Lance Taylor <iant@golang.org>
parent 194bbe84
......@@ -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{}) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment