mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Fixed a bug that forced datachannel timeout
The probetest answer response was not being sent until the select call received a datachannel timeout causing all attempted connections to fail.
This commit is contained in:
parent
a4f10d9d6e
commit
b5ce259858
1 changed files with 6 additions and 7 deletions
|
@ -137,16 +137,15 @@ func probeHandler(w http.ResponseWriter, r *http.Request) {
|
|||
// Set a timeout on peerconnection. If the connection state has not
|
||||
// advanced to PeerConnectionStateConnected in this time,
|
||||
// destroy the peer connection and return the token.
|
||||
go func() {
|
||||
select {
|
||||
case <-dataChan:
|
||||
if err := pc.Close(); err != nil {
|
||||
log.Printf("Error calling pc.Close: %v", err)
|
||||
}
|
||||
case <-time.After(dataChannelTimeout):
|
||||
}
|
||||
if err := pc.Close(); err != nil {
|
||||
log.Printf("Error calling pc.Close: %v", err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
return
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue