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.
jellyseerr
Harvey Tindall 9 months ago
parent a4d436b16b
commit 7c989fda08
No known key found for this signature in database
GPG Key ID: BBC65952848FB1A2

@ -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

@ -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…
Cancel
Save