Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Commit 70a65d3

Browse files
committed
quic: compute retransmission timeout correctly
Previously, if the expiry timestamp was in the future by less than 1ms, the retransmission timer would not have been scheduled. (This also removes an unused line from the test that this problem made flaky.) PR-URL: #157 Reviewed-By: James M Snell <[email protected]>
1 parent 92c25a6 commit 70a65d3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/node_quic_session.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,8 @@ void QuicSession::RemoveStream(int64_t stream_id) {
12911291
void QuicSession::ScheduleRetransmit() {
12921292
uint64_t now = uv_hrtime();
12931293
uint64_t expiry = ngtcp2_conn_get_expiry(Connection());
1294-
uint64_t interval = (expiry < now) ? 1 : ((expiry - now) / 1000000UL);
1294+
uint64_t interval = (expiry - now) / 1000000UL;
1295+
if (expiry < now || interval == 0) interval = 1;
12951296
Debug(this, "Scheduling the retransmit timer for %" PRIu64, interval);
12961297
UpdateRetransmitTimer(interval);
12971298
}

test/parallel/test-quic-packetloss.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --expose-internals
21
'use strict';
32

43
// This test is not yet working correctly because data

0 commit comments

Comments
 (0)