Commit c3e64636 authored by Matthew Holt's avatar Matthew Holt

A few comments, slight tweaks

parent d18cf12f
......@@ -39,7 +39,7 @@ var (
// The name and version of the application.
AppName, AppVersion string
// If true, initialization will not show any output.
// If true, initialization will not show any informative output.
Quiet bool
// 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) {
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))
if warnErr != nil {
// Most likely the host lookup failed or the port is unknown
......
......@@ -16,9 +16,9 @@ func init() {
letsencrypt.OnChange = func() error { return Restart(nil) }
}
// isLocalhost returns true if the string looks explicitly like a localhost address.
func isLocalhost(s string) bool {
return s == "localhost" || s == "::1" || strings.HasPrefix(s, "127.")
// isLocalhost returns true if host looks explicitly like a localhost address.
func isLocalhost(host string) bool {
return host == "localhost" || host == "::1" || strings.HasPrefix(host, "127.")
}
// checkFdlimit issues a warning if the OS max file descriptors is below a recommended minimum.
......
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