mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-12-22 09:00:10 +00:00
tls: don't "crash" on server close
TLS server section called Fatalf, while the normal section called Printf on server close. Fatalf is now only called if the server wasn't shutdown manually, e.g. when certificates are wrong. Same change was applied to non-tls section, so crashes will actually occur when things like ports are occupied. Fixes #343.
This commit is contained in:
parent
a4d436b16b
commit
7c989fda08
12
main.go
12
main.go
@ -566,11 +566,19 @@ func start(asDaemon, firstCall bool) {
|
||||
}
|
||||
}
|
||||
|
||||
app.err.Fatalf("Failure serving with SSL/TLS: %s", err)
|
||||
if err == http.ErrServerClosed {
|
||||
app.err.Printf("Failure serving with SSL/TLS: %s", err)
|
||||
} else {
|
||||
app.err.Fatalf("Failure serving with SSL/TLS: %s", err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if err := SRV.ListenAndServe(); err != nil {
|
||||
app.err.Printf("Failure serving: %s", err)
|
||||
if err == http.ErrServerClosed {
|
||||
app.err.Printf("Failure serving: %s", err)
|
||||
} else {
|
||||
app.err.Fatalf("Failure serving: %s", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
1
package-lock.json
generated
1
package-lock.json
generated
@ -15,7 +15,6 @@
|
||||
"any-date-parser": "^1.5.4",
|
||||
"browserslist": "^4.21.7",
|
||||
"cheerio": "^1.0.0-rc.12",
|
||||
"esbuild": "^0.18.20",
|
||||
"fs-cheerio": "^3.0.0",
|
||||
"inline-source": "^8.0.2",
|
||||
"jsdom": "^22.1.0",
|
||||
|
Loading…
Reference in New Issue
Block a user