mirror of
https://github.com/caddyserver/caddy.git
synced 2025-03-05 05:05:24 +08: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
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…
x
Reference in New Issue
Block a user