1
1
Fork 0
mirror of https://git.sr.ht/~emersion/tlstunnel synced 2024-04-26 06:45:03 +02:00

Fix SIGINT handling

Go's not very helpful here.
This commit is contained in:
Simon Ser 2021-02-17 18:37:30 +01:00
parent 373453ff23
commit f7fc805026
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -72,12 +72,12 @@ func main() {
for sig := range sigCh {
switch sig {
case syscall.SIGINT:
case syscall.SIGTERM:
case syscall.SIGINT, syscall.SIGTERM:
log.Print("stopping server")
srv.Stop()
return
case syscall.SIGHUP:
log.Print("caught SIGHUP, reloading config")
log.Print("reloading config")
newSrv, err := newServer()
if err != nil {
log.Printf("reload failed: %v", err)