summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-24 18:17:42 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-04-11 12:41:41 +0200
commit77e8749ee3722fd6610094d5750ac26c28c5ad29 (patch)
tree88bbb5c596c972016ab93d361b161f379d3430b6 /src
parentdef92ada4503841429e95d2bdec48d32f3e06c03 (diff)
Fix: don't clean recurring request except if forced
Change-Id: I669fc1f0b078e151dfb0cbb17c3d626bb43930d2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src')
-rw-r--r--src/diagnostic/diagnostic-manager.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/diagnostic/diagnostic-manager.cpp b/src/diagnostic/diagnostic-manager.cpp
index d236160b..6ab34577 100644
--- a/src/diagnostic/diagnostic-manager.cpp
+++ b/src/diagnostic/diagnostic-manager.cpp
@@ -166,18 +166,17 @@ void diagnostic_manager_t::cancel_request(active_diagnostic_request_t* entry)
/// @param[in] force - Force the cleaning or not ?
void diagnostic_manager_t::cleanup_request(active_diagnostic_request_t* entry, bool force)
{
- if((force || (entry->get_in_flight() && entry->request_completed())) && entry != nullptr)
+ if((force || (entry != nullptr && entry->get_in_flight() && entry->request_completed())))
{
entry->set_in_flight(false);
char request_string[128] = {0};
diagnostic_request_to_string(&entry->get_handle()->request,
request_string, sizeof(request_string));
- if(entry->get_recurring())
+ if(force && entry->get_recurring())
{
find_and_erase(entry, recurring_requests_);
- if(force)
- cancel_request(entry);
+ cancel_request(entry);
DEBUG(binder_interface, "cleanup_request: Cancelling completed, recurring request: %s", request_string);
}
else