mirror of https://github.com/hashicorp/consul
agent: Fixing panic on shutdown
parent
e99f9dd070
commit
6a640604dd
|
@ -179,7 +179,7 @@ func (ln tcpKeepAliveListener) Accept() (c net.Conn, err error) {
|
||||||
// Shutdown is used to shutdown the HTTP server
|
// Shutdown is used to shutdown the HTTP server
|
||||||
func (s *HTTPServer) Shutdown() {
|
func (s *HTTPServer) Shutdown() {
|
||||||
if s != nil {
|
if s != nil {
|
||||||
s.logger.Printf("[DEBUG] http: Shutting down http server(%v)", s.addr)
|
s.logger.Printf("[DEBUG] http: Shutting down http server (%v)", s.addr)
|
||||||
s.listener.Close()
|
s.listener.Close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,7 +141,6 @@ func (s *scadaListener) Close() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
s.closed = true
|
s.closed = true
|
||||||
close(s.pending)
|
|
||||||
close(s.closedCh)
|
close(s.closedCh)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue