Skip to content

Commit

Permalink
quic: compute retransmission timeout correctly
Browse files Browse the repository at this point in the history
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: nodejs#157
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
addaleax authored and juanarbol committed Dec 17, 2019
1 parent ce19b4b commit 08f721e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/node_quic_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,8 @@ void QuicSession::RemoveStream(int64_t stream_id) {
void QuicSession::ScheduleRetransmit() {
uint64_t now = uv_hrtime();
uint64_t expiry = ngtcp2_conn_get_expiry(Connection());
uint64_t interval = (expiry < now) ? 1 : ((expiry - now) / 1000000UL);
uint64_t interval = (expiry - now) / 1000000UL;
if (expiry < now || interval == 0) interval = 1;
Debug(this, "Scheduling the retransmit timer for %" PRIu64, interval);
UpdateRetransmitTimer(interval);
}
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-quic-packetloss.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-internals
'use strict';

// This test is not yet working correctly because data
Expand Down

0 comments on commit 08f721e

Please sign in to comment.