mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Use chan struct{} instead of chan bool in openChan.
http://dave.cheney.net/2014/03/25/the-empty-struct "...there is one important practical use of empty structs, and that is the chan struct{} construct used for signaling between go routines"
This commit is contained in:
parent
48db4ac132
commit
a77ae6b771
1 changed files with 2 additions and 2 deletions
|
@ -104,7 +104,7 @@ func dialWebRTC(config *webrtc.Configuration, meek *MeekChannel) (
|
|||
|
||||
offerChan := make(chan *webrtc.SessionDescription)
|
||||
errChan := make(chan error)
|
||||
openChan := make(chan bool)
|
||||
openChan := make(chan struct{})
|
||||
|
||||
pc, err := webrtc.NewPeerConnection(config)
|
||||
if err != nil {
|
||||
|
@ -151,7 +151,7 @@ func dialWebRTC(config *webrtc.Configuration, meek *MeekChannel) (
|
|||
}
|
||||
dc.OnOpen = func() {
|
||||
log.Println("OnOpen channel")
|
||||
openChan <- true
|
||||
openChan <- struct{}{}
|
||||
}
|
||||
dc.OnClose = func() {
|
||||
log.Println("OnClose channel")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue