Fix handshake retransmit timing

in_flight.crypto can be 0 when retransmitted handshake data is pending
but not yet actually retransmitted.
This commit is contained in:
Benjamin Saunders
2019-03-28 19:44:39 -07:00
committed by Dirkjan Ochtman
parent 3995ea2006
commit d36d015c9b
+4 -1
View File
@@ -662,7 +662,10 @@ impl Connection {
} }
fn set_loss_detection_timer(&mut self) { fn set_loss_detection_timer(&mut self) {
if self.in_flight.crypto != 0 || (self.state.is_handshake() && self.side.is_client()) { if self.in_flight.crypto != 0
|| self.crypto_count != 0
|| (self.state.is_handshake() && self.side.is_client())
{
// Handshake retransmission alarm. // Handshake retransmission alarm.
let timeout = if let Some(smoothed) = self.rtt.smoothed { let timeout = if let Some(smoothed) = self.rtt.smoothed {
2 * smoothed 2 * smoothed