Better error handling at startup and fixed some bugs

Fixed bug where manually specifying port 443 disabled TLS (whoops); otherHostHasScheme was the culprit, since it would return true even if it was the same config that had that scheme.

Also, an error at startup (if not a restart) is now fatal, rather than keeping a half-alive zombie server.
This commit is contained in:
Matthew Holt
2015-11-03 12:01:54 -07:00
parent e8006acf80
commit 5e1573dd84
4 changed files with 57 additions and 41 deletions

View File

@ -79,7 +79,11 @@ func main() {
// Start your engines
err = caddy.Start(caddyfile)
if err != nil {
log.Fatal(err)
if caddy.IsRestart() {
log.Println("error starting servers:", err)
} else {
log.Fatal(err)
}
}
// Twiddle your thumbs