Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Anti-censorship
Pluggable Transports
Snowflake
Commits
1fa9bc05
Commit
1fa9bc05
authored
Jun 29, 2017
by
David Fifield
Browse files
Remove SIGINT handling (no longer part of pt-spec).
parent
c3f87281
Changes
1
Hide whitespace changes
Inline
Side-by-side
client/snowflake.go
View file @
1fa9bc05
...
...
@@ -198,9 +198,9 @@ func main() {
var
numHandlers
int
=
0
var
sig
os
.
Signal
sigChan
:=
make
(
chan
os
.
Signal
,
1
)
signal
.
Notify
(
sigChan
,
syscall
.
SIGINT
,
syscall
.
SIGTERM
)
signal
.
Notify
(
sigChan
,
syscall
.
SIGTERM
)
// wait for
first
signal
//
keep track of handlers and
wait for
a
signal
sig
=
nil
for
sig
==
nil
{
select
{
...
...
@@ -209,17 +209,16 @@ func main() {
case
sig
=
<-
sigChan
:
}
}
// signal received, shut down
for
_
,
ln
:=
range
listeners
{
ln
.
Close
()
}
snowflakes
.
End
()
// wait for second signal or no more handlers
sig
=
nil
for
sig
==
nil
&&
numHandlers
!=
0
{
select
{
case
n
:=
<-
handlerChan
:
numHandlers
+=
n
case
sig
=
<-
sigChan
:
for
n
:=
range
handlerChan
{
numHandlers
+=
n
if
numHandlers
==
0
{
break
}
}
log
.
Println
(
"snowflake is done."
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment