ntp: avoid unnecessary restart of resolving round on refresh

Don't call NSR_ResolveSources() when a resolving round is already
started. This cuts the number of calls of the system resolver made due
to the refresh command to half.
This commit is contained in:
Miroslav Lichvar 2024-03-14 15:37:15 +01:00
parent 6e5513c80b
commit 863866354d

View file

@ -1056,7 +1056,10 @@ resolve_source_replacement(SourceRecord *record, int refreshment)
us->address = *record->remote_addr;
append_unresolved_source(us);
NSR_ResolveSources();
/* Don't restart resolving round if already running */
if (!resolving_source)
NSR_ResolveSources();
}
/* ================================================== */