Skip to content

Commit c793ea3

Browse files
committed
net/http: remove dead code noted in post-submit review of CL 81778
Per comments in #20239 (comment) Updates #20239 Updates #26303 Change-Id: Iddf34c0452bd30ca9111b951bca48d1e011bd85a Reviewed-on: https://go-review.googlesource.com/122820 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 194bbe8 commit c793ea3

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

src/net/http/server.go

+1-16
Original file line numberDiff line numberDiff line change
@@ -2806,9 +2806,6 @@ func (srv *Server) Serve(l net.Listener) error {
28062806
return err
28072807
}
28082808

2809-
serveDone := make(chan struct{})
2810-
defer close(serveDone)
2811-
28122809
if !srv.trackListener(&l, true) {
28132810
return ErrServerClosed
28142811
}
@@ -2910,11 +2907,6 @@ func (s *Server) trackListener(ln *net.Listener, add bool) bool {
29102907
if s.shuttingDown() {
29112908
return false
29122909
}
2913-
// If the *Server is being reused after a previous
2914-
// Close or Shutdown, reset its doneChan:
2915-
if len(s.listeners) == 0 && len(s.activeConn) == 0 {
2916-
s.doneChan = nil
2917-
}
29182910
s.listeners[ln] = struct{}{}
29192911
} else {
29202912
delete(s.listeners, ln)
@@ -2973,14 +2965,7 @@ func (srv *Server) SetKeepAlivesEnabled(v bool) {
29732965
// Close idle HTTP/1 conns:
29742966
srv.closeIdleConns()
29752967

2976-
// Close HTTP/2 conns, as soon as they become idle, but reset
2977-
// the chan so future conns (if the listener is still active)
2978-
// still work and don't get a GOAWAY immediately, before their
2979-
// first request:
2980-
srv.mu.Lock()
2981-
defer srv.mu.Unlock()
2982-
srv.closeDoneChanLocked() // closes http2 conns
2983-
srv.doneChan = nil
2968+
// TODO: Issue 26303: close HTTP/2 conns as soon as they become idle.
29842969
}
29852970

29862971
func (s *Server) logf(format string, args ...interface{}) {

0 commit comments

Comments
 (0)