aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/diagnostic/diagnostic-manager.cpp2
-rw-r--r--src/low-can-binding.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/diagnostic/diagnostic-manager.cpp b/src/diagnostic/diagnostic-manager.cpp
index 2d4669e..69e2a7c 100644
--- a/src/diagnostic/diagnostic-manager.cpp
+++ b/src/diagnostic/diagnostic-manager.cpp
@@ -161,7 +161,7 @@ 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()))
+ if((force || (entry->get_in_flight() && entry->request_completed())) && entry != nullptr)
{
entry->set_in_flight(false);
diff --git a/src/low-can-binding.cpp b/src/low-can-binding.cpp
index d88ac99..3e87072 100644
--- a/src/low-can-binding.cpp
+++ b/src/low-can-binding.cpp
@@ -139,8 +139,6 @@ static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe,
// no matter what we want, worse case will be a fail unsubscription but at least we don't
// poll a PID for nothing.
if(found.front()->get_supported())
- subscribe = false;
- if(subscribe)
{
float frequency = found.front()->get_frequency();
configuration_t::instance().get_diagnostic_manager().add_recurring_request(
@@ -149,8 +147,11 @@ static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe,
}
else
{
+ found.front()->set_supported(false);
configuration_t::instance().get_diagnostic_manager().cleanup_request(
configuration_t::instance().get_diagnostic_manager().find_recurring_request(diag_req), true);
+ DEBUG(binder_interface, "Signal: %s isn't supported. Canceling operation.", sig.c_str());
+ return -1;
}
}