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
f1ab65b1
Commit
f1ab65b1
authored
Dec 24, 2019
by
David Fifield
Browse files
Close the melt channel, don't just send once on it.
Closing the channel makes it always immediately selectable.
parent
febb4936
Changes
1
Hide whitespace changes
Inline
Side-by-side
client/lib/peers.go
View file @
f1ab65b1
...
...
@@ -35,7 +35,7 @@ func NewPeers(max int) *Peers {
// Use buffered go channel to pass snowflakes onwards to the SOCKS handler.
p
.
snowflakeChan
=
make
(
chan
Snowflake
,
max
)
p
.
activePeers
=
list
.
New
()
p
.
melt
=
make
(
chan
struct
{}
,
1
)
p
.
melt
=
make
(
chan
struct
{})
return
p
}
...
...
@@ -110,7 +110,7 @@ func (p *Peers) purgeClosedPeers() {
// Close all Peers contained here.
func
(
p
*
Peers
)
End
()
{
close
(
p
.
snowflakeChan
)
p
.
melt
<-
struct
{}{}
close
(
p
.
melt
)
cnt
:=
p
.
Count
()
for
e
:=
p
.
activePeers
.
Front
();
e
!=
nil
;
{
next
:=
e
.
Next
()
...
...
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