From 2a7a6e3503b94f45e6a3fd32e2dd83168083d040 Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Wed, 13 Jun 2012 13:23:55 +0200 Subject: [PATCH] Don't LOG_NOTICE when remote server has seen latest OTP too. This is an expected condition for many (most) validation requests using the asynchronous validation protocol 2.0. --- ykval-synclib.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ykval-synclib.php b/ykval-synclib.php index c24d221..2627b20 100644 --- a/ykval-synclib.php +++ b/ykval-synclib.php @@ -328,8 +328,12 @@ class SyncLib /* Retrieve info from entry info string */ + /* This is the counter values we had in our database *before* processing the current OTP. */ $validationParams=$this->localParamsFromInfoString($entry['info']); + /* This is the data from the current OTP. */ $otpParams=$this->otpParamsFromInfoString($entry['info']); + + /* Fetch current information from our database */ $localParams=$this->getLocalParams($otpParams['yk_publicname']); $this->log(LOG_DEBUG, "validation params: ", $validationParams); @@ -342,7 +346,11 @@ class SyncLib } if ($this->countersHigherThan($resParams, $validationParams)) { - $this->log(LOG_NOTICE, "Local server out of sync compared to counters at validation request time. "); + if ($this->countersEqual($resParams, $otpParams)) { + $this->log(LOG_INFO, "Remote server had received the current counter values already. "); + } else { + $this->log(LOG_NOTICE, "Local server out of sync compared to counters at validation request time. "); + } } if ($this->countersHigherThan($localParams, $resParams)) {