Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Send Logic to 64-bit Time #3848

Merged
merged 12 commits into from
Sep 11, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 18 additions & 20 deletions src/core/loss_detection.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,30 +341,28 @@ QuicLossDetectionUpdateTimer(
//
Delay = 0;

} else if (OldestPacket != NULL) {
//
// Limit the timeout to the remainder of the disconnect timeout if there
// is an outstanding packet.
//
const uint64_t DisconnectTime =
OldestPacket->SentTime + MS_TO_US(Connection->Settings.DisconnectTimeoutMs);
if (CxPlatTimeAtOrBefore64(DisconnectTime, TimeNow)) {
Delay = 0;
} else {
Delay = CxPlatTimeDiff64(TimeNow, TimeFires);
const uint64_t MaxDelay = CxPlatTimeDiff64(TimeNow, DisconnectTime);
if (Delay > MaxDelay) {
Delay = MaxDelay;
}
}

} else {
//
// Wait the normal delay.
//
Delay = CxPlatTimeDiff64(TimeNow, TimeFires);

if (OldestPacket != NULL) {
//
// Limit the timeout to the remainder of the disconnect timeout if there
// is an outstanding packet.
//
const uint64_t DisconnectTime =
OldestPacket->SentTime + MS_TO_US(Connection->Settings.DisconnectTimeoutMs);
if (CxPlatTimeAtOrBefore64(DisconnectTime, TimeNow)) {
csujedihy marked this conversation as resolved.
Show resolved Hide resolved
Delay = 0;
} else {
const uint64_t MaxDelay = CxPlatTimeDiff64(TimeNow, DisconnectTime);
if (Delay > MaxDelay) {
Delay = MaxDelay;
}
}
}
}


if (Delay == 0 && ExecuteImmediatelyIfNecessary) {
//
// In some cases if the timer already should have elapsed we will
Expand Down