зеркало из https://github.com/microsoft/msquic.git
Initialize Path Smoothed RTT Field (#169)
This commit is contained in:
Родитель
710cd7ff88
Коммит
1a3d3058c4
|
@ -653,6 +653,13 @@ QuicConnUpdateRtt(
|
|||
BOOLEAN RttUpdated;
|
||||
UNREFERENCED_PARAMETER(Connection);
|
||||
|
||||
if (LatestRtt == 0) {
|
||||
//
|
||||
// RTT cannot be zero or several loss recovery algorithms break down.
|
||||
//
|
||||
LatestRtt = 1;
|
||||
}
|
||||
|
||||
Path->LatestRttSample = LatestRtt;
|
||||
if (LatestRtt < Path->MinRtt) {
|
||||
Path->MinRtt = LatestRtt;
|
||||
|
@ -680,6 +687,7 @@ QuicConnUpdateRtt(
|
|||
}
|
||||
|
||||
if (RttUpdated) {
|
||||
QUIC_DBG_ASSERT(Path->SmoothedRtt != 0);
|
||||
QuicTraceLogConnVerbose(RttUpdated, Connection, "Updated Rtt=%u.%u ms, Var=%u.%u",
|
||||
Path->SmoothedRtt / 1000, Path->SmoothedRtt % 1000,
|
||||
Path->RttVariance / 1000, Path->RttVariance % 1000);
|
||||
|
|
|
@ -174,6 +174,8 @@ QuicLossDetectionComputeProbeTimeout(
|
|||
{
|
||||
QUIC_CONNECTION* Connection = QuicLossDetectionGetConnection(LossDetection);
|
||||
|
||||
QUIC_DBG_ASSERT(Path->SmoothedRtt != 0);
|
||||
|
||||
//
|
||||
// Microseconds.
|
||||
//
|
||||
|
@ -242,6 +244,8 @@ QuicLossDetectionUpdateTimer(
|
|||
|
||||
uint32_t TimeNow = QuicTimeUs32();
|
||||
|
||||
QUIC_DBG_ASSERT(Path->SmoothedRtt != 0);
|
||||
|
||||
uint32_t TimeFires;
|
||||
QUIC_LOSS_TIMER_TYPE TimeoutType;
|
||||
if (OldestPacket != NULL &&
|
||||
|
|
|
@ -30,6 +30,11 @@ QuicPathInitialize(
|
|||
Path->ID = Connection->NextPathId++; // TODO - Check for duplicates after wrap around?
|
||||
Path->MinRtt = UINT32_MAX;
|
||||
Path->Mtu = QUIC_DEFAULT_PATH_MTU;
|
||||
if (Connection->Session != NULL) {
|
||||
Path->SmoothedRtt = MS_TO_US(Connection->Session->Settings.InitialRttMs);
|
||||
} else {
|
||||
Path->SmoothedRtt = MS_TO_US(QUIC_INITIAL_RTT);
|
||||
}
|
||||
|
||||
QuicTraceLogConnInfo(PathInitialized, Connection, "Path[%u] Initialized", Path->ID);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче