Log net.Listener.Close errors
This commit is contained in:
parent
859c993a82
commit
826cbd7fe1
14
server.go
14
server.go
|
@ -119,8 +119,10 @@ func (srv *Server) Start() error {
|
||||||
|
|
||||||
func (srv *Server) Stop() {
|
func (srv *Server) Stop() {
|
||||||
srv.cancelACME()
|
srv.cancelACME()
|
||||||
for _, ln := range srv.Listeners {
|
for addr, ln := range srv.Listeners {
|
||||||
ln.Stop()
|
if err := ln.Stop(); err != nil {
|
||||||
|
log.Printf("listener %q: failed to stop: %v", addr, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
srv.acmeCache.cache.Stop()
|
srv.acmeCache.cache.Stop()
|
||||||
}
|
}
|
||||||
|
@ -159,7 +161,9 @@ func (srv *Server) Replace(old *Server) error {
|
||||||
if ln, ok := srv.Listeners[addr]; ok {
|
if ln, ok := srv.Listeners[addr]; ok {
|
||||||
srv.Listeners[addr] = oldLn.UpdateFrom(ln)
|
srv.Listeners[addr] = oldLn.UpdateFrom(ln)
|
||||||
} else {
|
} else {
|
||||||
oldLn.Stop()
|
if err := oldLn.Stop(); err != nil {
|
||||||
|
log.Printf("listener %q: failed to stop: %v", addr, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,8 +235,8 @@ func (ln *Listener) Start() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ln *Listener) Stop() {
|
func (ln *Listener) Stop() error {
|
||||||
ln.netLn.Close()
|
return ln.netLn.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ln *Listener) UpdateFrom(new *Listener) *Listener {
|
func (ln *Listener) UpdateFrom(new *Listener) *Listener {
|
||||||
|
|
Loading…
Reference in New Issue