Check that the previous state of the service was ready or online
before decreasing the notifier count when moving to the disconnected
state. Do the same when moving to failure state.
---
src/service.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/service.c b/src/service.c
index 8c989f1..5c8f9d0 100644
--- a/src/service.c
+++ b/src/service.c
@@ -5369,7 +5369,9 @@ static int service_indicate_state(struct connman_service
*service)
domain_changed(service);
proxy_changed(service);
- __connman_notifier_disconnect(service->type);
+ if (old_state == CONNMAN_SERVICE_STATE_READY ||
+ old_state == CONNMAN_SERVICE_STATE_ONLINE)
+ __connman_notifier_disconnect(service->type);
/*
* Previous services which are connected and which states
@@ -5382,6 +5384,10 @@ static int service_indicate_state(struct connman_service
*service)
}
if (new_state == CONNMAN_SERVICE_STATE_FAILURE) {
+ if (old_state == CONNMAN_SERVICE_STATE_READY ||
+ old_state == CONNMAN_SERVICE_STATE_ONLINE)
+ __connman_notifier_disconnect(service->type);
+
if (service->userconnect &&
connman_agent_report_error(service, service->path,
error2string(service->error),
--
1.7.10.4
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman