0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00

Check for nil listener before printing address (#1946)

* Checking that a server listener is not nil before printing verbose information

* Improved readability of a loop
This commit is contained in:
insomniac 2017-11-07 17:08:54 +00:00 committed by Matt Holt
parent 5f39cbef94
commit 169ab3acda

View file

@ -518,6 +518,11 @@ func startWithListenerFds(cdyfile Input, inst *Instance, restartFds map[string]r
} }
if !Quiet { if !Quiet {
for _, srvln := range inst.servers { for _, srvln := range inst.servers {
// only show FD notice if the listener is not nil.
// This can happen when only serving UDP or TCP
if srvln.listener == nil {
continue
}
if !IsLoopback(srvln.listener.Addr().String()) { if !IsLoopback(srvln.listener.Addr().String()) {
checkFdlimit() checkFdlimit()
break break