Initialize Path Smoothed RTT Field (#169)

This commit is contained in:
Nick Banks 2020-02-21 14:10:42 -08:00 коммит произвёл GitHub
Родитель 710cd7ff88
Коммит 1a3d3058c4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@ -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);
}