mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Exit immediately after SIGTERM is there are no signals running.
Cf. https://bugs.torproject.org/24875
This commit is contained in:
parent
6a9c2bf951
commit
bdc1798adb
2 changed files with 4 additions and 10 deletions
|
@ -241,11 +241,8 @@ func main() {
|
|||
ln.Close()
|
||||
}
|
||||
snowflakes.End()
|
||||
for n := range handlerChan {
|
||||
numHandlers += n
|
||||
if numHandlers == 0 {
|
||||
break
|
||||
}
|
||||
for numHandlers > 0 {
|
||||
numHandlers += <-handlerChan
|
||||
}
|
||||
log.Println("snowflake is done.")
|
||||
}
|
||||
|
|
|
@ -393,10 +393,7 @@ func main() {
|
|||
for _, server := range servers {
|
||||
server.Close()
|
||||
}
|
||||
for n := range handlerChan {
|
||||
numHandlers += n
|
||||
if numHandlers == 0 {
|
||||
break
|
||||
}
|
||||
for numHandlers > 0 {
|
||||
numHandlers += <-handlerChan
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue