mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 13:25:06 -05:00
Use initial delay also for burst samples
This commit is contained in:
20
ntp_core.c
20
ntp_core.c
@@ -1832,20 +1832,10 @@ NCR_InitiateSampleBurst(NCR_Instance inst, int n_good_samples, int n_total_sampl
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MD_ONLINE:
|
case MD_ONLINE:
|
||||||
inst->opmode = MD_BURST_WAS_ONLINE;
|
|
||||||
inst->burst_good_samples_to_go = n_good_samples;
|
|
||||||
inst->burst_total_samples_to_go = n_total_samples;
|
|
||||||
if (inst->timer_running) {
|
|
||||||
SCH_RemoveTimeout(inst->timeout_id);
|
|
||||||
}
|
|
||||||
inst->timer_running = 1;
|
|
||||||
inst->timeout_id = SCH_AddTimeoutInClass(0.0, SAMPLING_SEPARATION,
|
|
||||||
SAMPLING_RANDOMNESS,
|
|
||||||
SCH_NtpSamplingClass,
|
|
||||||
transmit_timeout, (void *) inst);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MD_OFFLINE:
|
case MD_OFFLINE:
|
||||||
|
if (inst->opmode == MD_ONLINE)
|
||||||
|
inst->opmode = MD_BURST_WAS_ONLINE;
|
||||||
|
else
|
||||||
inst->opmode = MD_BURST_WAS_OFFLINE;
|
inst->opmode = MD_BURST_WAS_OFFLINE;
|
||||||
inst->burst_good_samples_to_go = n_good_samples;
|
inst->burst_good_samples_to_go = n_good_samples;
|
||||||
inst->burst_total_samples_to_go = n_total_samples;
|
inst->burst_total_samples_to_go = n_total_samples;
|
||||||
@@ -1853,13 +1843,11 @@ NCR_InitiateSampleBurst(NCR_Instance inst, int n_good_samples, int n_total_sampl
|
|||||||
SCH_RemoveTimeout(inst->timeout_id);
|
SCH_RemoveTimeout(inst->timeout_id);
|
||||||
}
|
}
|
||||||
inst->timer_running = 1;
|
inst->timer_running = 1;
|
||||||
inst->timeout_id = SCH_AddTimeoutInClass(0.0, SAMPLING_SEPARATION,
|
inst->timeout_id = SCH_AddTimeoutInClass(INITIAL_DELAY, SAMPLING_SEPARATION,
|
||||||
SAMPLING_RANDOMNESS,
|
SAMPLING_RANDOMNESS,
|
||||||
SCH_NtpSamplingClass,
|
SCH_NtpSamplingClass,
|
||||||
transmit_timeout, (void *) inst);
|
transmit_timeout, (void *) inst);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user