GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit b5ce2598 authored by Cecylia Bocovich's avatar Cecylia Bocovich

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.
parent a4f10d9d
......@@ -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.
select {
case <-dataChan:
if err := pc.Close(); err != nil {
log.Printf("Error calling pc.Close: %v", err)
go func() {
select {
case <-dataChan:
case <-time.After(dataChannelTimeout):
}
case <-time.After(dataChannelTimeout):
if err := pc.Close(); err != nil {
log.Printf("Error calling pc.Close: %v", err)
}
}
}()
return
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment