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:
parent
5f39cbef94
commit
169ab3acda
1 changed files with 5 additions and 0 deletions
5
caddy.go
5
caddy.go
|
@ -518,6 +518,11 @@ func startWithListenerFds(cdyfile Input, inst *Instance, restartFds map[string]r
|
|||
}
|
||||
if !Quiet {
|
||||
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()) {
|
||||
checkFdlimit()
|
||||
break
|
||||
|
|
Loading…
Reference in a new issue