From 0ebc7362ff32637ac839b0b5adf9678277c9c332 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Thu, 30 Mar 2017 17:23:02 +0200 Subject: Handle simultaneous subscription to diagnostic messages. Delay new recurring requests if there are already existing in flight and cleanup active request to correctly set in_flight_ flag to false else new request can't be launched as there is always an old one considered running... Modify a little bit DEBUG message and cleanup useless code. Change-Id: I39f865bbc6d00188d3cddd1d81437b9e3ca51269 Signed-off-by: Romain Forlot --- src/diagnostic/active-diagnostic-request.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/diagnostic/active-diagnostic-request.cpp') diff --git a/src/diagnostic/active-diagnostic-request.cpp b/src/diagnostic/active-diagnostic-request.cpp index ad6e59e..8b6f054 100644 --- a/src/diagnostic/active-diagnostic-request.cpp +++ b/src/diagnostic/active-diagnostic-request.cpp @@ -156,12 +156,12 @@ bool active_diagnostic_request_t::is_diagnostic_signal(const std::string& name) /// @brief Check is the request should be sent or not /// /// @return true if the request is not running or recurring nor completed, -/// or it's recurring, its clock elapsed, request was successful +/// or it's recurring, its clock elapsed /// so it's time to send another one. bool active_diagnostic_request_t::should_send() { - return !in_flight_ || (!recurring_ && !request_completed()) || - (recurring_ && frequency_clock_.elapsed(true) && request_completed() && handle_->success); + return !in_flight_ && ( (!recurring_ && !request_completed()) || + (recurring_ && frequency_clock_.elapsed(true)) ); } /// @brief check if the timeout clock has elapsed -- cgit 1.2.3-korg