sources: separate update of leap status

Remove leap status from the NTP sample and set it independently from
the sample accumulation in order to accept a leap second sooner when
samples are filtered.
This commit is contained in:
Miroslav Lichvar
2020-03-11 15:48:00 +01:00
parent ff9301567e
commit 2582be8754
8 changed files with 20 additions and 10 deletions

View File

@@ -326,6 +326,17 @@ SRC_GetSourcestats(SRC_Instance instance)
/* ================================================== */
void
SRC_SetLeapStatus(SRC_Instance inst, NTP_Leap leap)
{
if (REF_IsLeapSecondClose())
return;
inst->leap = leap;
}
/* ================================================== */
/* This function is called by one of the source drivers when it has
a new sample that is to be accumulated.
@@ -351,7 +362,6 @@ SRC_AccumulateSample(SRC_Instance inst, NTP_Sample *sample)
SST_AccumulateSample(inst->stats, sample);
SST_DoNewRegression(inst->stats);
inst->leap = sample->leap;
}
/* ================================================== */