mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 02:35:06 -05:00
sources: allow setting minsamples and maxsamples for each source
The minsamples and maxsamples directives now set the default value, which can be overriden for individual sources in the server/peer/pool and refclock directives.
This commit is contained in:
@@ -207,14 +207,19 @@ void SRC_Finalise(void)
|
||||
/* Function to create a new instance. This would be called by one of
|
||||
the individual source-type instance creation routines. */
|
||||
|
||||
SRC_Instance SRC_CreateNewInstance(uint32_t ref_id, SRC_Type type, SRC_SelectOption sel_option, IPAddr *addr)
|
||||
SRC_Instance SRC_CreateNewInstance(uint32_t ref_id, SRC_Type type, SRC_SelectOption sel_option, IPAddr *addr, int min_samples, int max_samples)
|
||||
{
|
||||
SRC_Instance result;
|
||||
|
||||
assert(initialised);
|
||||
|
||||
if (min_samples == SRC_DEFAULT_MINSAMPLES)
|
||||
min_samples = CNF_GetMinSamples();
|
||||
if (max_samples == SRC_DEFAULT_MAXSAMPLES)
|
||||
max_samples = CNF_GetMaxSamples();
|
||||
|
||||
result = MallocNew(struct SRC_Instance_Record);
|
||||
result->stats = SST_CreateInstance(ref_id, addr);
|
||||
result->stats = SST_CreateInstance(ref_id, addr, min_samples, max_samples);
|
||||
|
||||
if (n_sources == max_n_sources) {
|
||||
/* Reallocate memory */
|
||||
|
||||
Reference in New Issue
Block a user