Commit 169ab3ac authored by insomniac's avatar insomniac Committed by Matt Holt

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
parent 5f39cbef
...@@ -518,6 +518,11 @@ func startWithListenerFds(cdyfile Input, inst *Instance, restartFds map[string]r ...@@ -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
......
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