Only $req_answers sync peers would get polled. When $req_answers is
less than $nr_servers, some servers (that return replayed counters)
will get ignored, since retrieveURLasync() stops after $req_answers
responses.
The fix requires $nr_servers responses from retrieveURLasync, causing
all sync peers to get polled and processed by sync().
This arrangement also allows a two-server sync pool to operate when
one peer is gone or unreachable, something that cannot be done before
these modifications. Set the sync_level to 0, which means
"try everyone, but if you get no valid responses, it's okay to proceed".
Prior to the modifications, it means "don't even try syncing".
Also, added ykval-cron, which can be fired off from a cron job to
make sure ykval-queue stays running. This is example code, as
your enviroment and usernames may differ.
- simplify and avoid using different arrays with same values.
- build $otpParams from $otpinfo as soon as we have ksm result,
then unset $otpinfo.
- futher down, only use $otpParams and $localParams.
- avoid doing what is already handled by the Log class.
- the log name is appended automatically,
so don't append it again in the invocation.
i.e. "ykval-verify"
- the log level name is also appended automatically,
so don't append it manually, especially when it doesn't match the log priority!
i.e. LOG_WARNING -> ":notice:"
- fix whitespace in some messages.
- strftime -> date.
- strftime is same as date, but with locales.
- date format doesn't output names (January, March, etc.),
so locale doesn't matter.
- also, would we really want locale in logs?
- Log::log() internally support array implode,
so no need to duplicate functionality.
- however, the internal implode uses two consecutive spaces as separator,
so this will change the log format slightly.
e.g. "delta=x now=y" becomes "delta=x now=y"
- same as 1e799aa6e57dffcb7baeb130919180bef22ea085.
- group $timeout filtering and validation.
- this commit might change replies sent to clients,
since the validation check is done eaerlier now,
and we might return S_MISSING_PARAM before S_BAD_OTP for example.
- this should really not cause any issues though,
the order of which error is raised first should not matter to clients.
- group $sl filtering and validation.
- this commit might change replies sent to clients,
since the validation check is done eaerlier now,
and we might return S_MISSING_PARAM before S_BAD_OTP for example.
- this should really not cause any issues though,
the order of which error is raised first should not matter to clients.