Skip to content

Commit

Permalink
Fix DTLS client role in long delay connections
Browse files Browse the repository at this point in the history
Fixes pion/webrtc#2089

When a retranmission from the remote side arrives after
the handshake is complete, the `finish` routine
puts it back into retransmit loop.

With Chrome, this fails after 15 seconds.
Firefox does not error out though.
  • Loading branch information
boks1971 committed Feb 2, 2022
1 parent 17f86a3 commit 61ae442
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Arlo Breault <[email protected]>
Atsushi Watanabe <[email protected]>
backkem <[email protected]>
bjdgyc <[email protected]>
boks1971 <[email protected]>
Bragadeesh <[email protected]>
Carson Hoffman <[email protected]>
Cecylia Bocovich <[email protected]>
Expand Down
3 changes: 3 additions & 0 deletions handshaker.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ func (s *handshakeFSM) finish(ctx context.Context, c flightConn) (handshakeState
if nextFlight == 0 {
break
}
if s.currentFlight == nextFlight && (nextFlight.isLastRecvFlight() || nextFlight.isLastSendFlight()) {
return handshakeFinished, nil
}
<-retransmitTimer.C
// Retransmit last flight
return handshakeSending, nil
Expand Down

0 comments on commit 61ae442

Please sign in to comment.