mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-13 22:51:08 -05:00
A few comments, slight tweaks
This commit is contained in:
parent
d18cf12f14
commit
c3e6463676
3 changed files with 5 additions and 4 deletions
|
@ -39,7 +39,7 @@ var (
|
||||||
// The name and version of the application.
|
// The name and version of the application.
|
||||||
AppName, AppVersion string
|
AppName, AppVersion string
|
||||||
|
|
||||||
// If true, initialization will not show any output.
|
// If true, initialization will not show any informative output.
|
||||||
Quiet bool
|
Quiet bool
|
||||||
|
|
||||||
// DefaultInput is the default configuration to use when config input is empty or missing.
|
// DefaultInput is the default configuration to use when config input is empty or missing.
|
||||||
|
|
|
@ -278,6 +278,7 @@ func arrangeBindings(allConfigs []server.Config) (Group, error) {
|
||||||
func resolveAddr(conf server.Config) (resolvAddr *net.TCPAddr, warnErr error, fatalErr error) {
|
func resolveAddr(conf server.Config) (resolvAddr *net.TCPAddr, warnErr error, fatalErr error) {
|
||||||
bindHost := conf.BindHost
|
bindHost := conf.BindHost
|
||||||
|
|
||||||
|
// TODO: Do we even need the port? Maybe we just need to look up the host.
|
||||||
resolvAddr, warnErr = net.ResolveTCPAddr("tcp", net.JoinHostPort(bindHost, conf.Port))
|
resolvAddr, warnErr = net.ResolveTCPAddr("tcp", net.JoinHostPort(bindHost, conf.Port))
|
||||||
if warnErr != nil {
|
if warnErr != nil {
|
||||||
// Most likely the host lookup failed or the port is unknown
|
// Most likely the host lookup failed or the port is unknown
|
||||||
|
|
|
@ -16,9 +16,9 @@ func init() {
|
||||||
letsencrypt.OnChange = func() error { return Restart(nil) }
|
letsencrypt.OnChange = func() error { return Restart(nil) }
|
||||||
}
|
}
|
||||||
|
|
||||||
// isLocalhost returns true if the string looks explicitly like a localhost address.
|
// isLocalhost returns true if host looks explicitly like a localhost address.
|
||||||
func isLocalhost(s string) bool {
|
func isLocalhost(host string) bool {
|
||||||
return s == "localhost" || s == "::1" || strings.HasPrefix(s, "127.")
|
return host == "localhost" || host == "::1" || strings.HasPrefix(host, "127.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// checkFdlimit issues a warning if the OS max file descriptors is below a recommended minimum.
|
// checkFdlimit issues a warning if the OS max file descriptors is below a recommended minimum.
|
||||||
|
|
Loading…
Reference in a new issue