If we call it at READY or ONLINE state, The function will be called
twice and connected times is set as two. And StateChanged signal "offline"
will never be emitted.
Commit
59a8daa3 ("ONLINE and LOGIN are also "connected" states.") added
a check for also state CONNMAN_SERVICE_STATE_LOGIN in
__connman_service_indicate_state(). But this meant that
__connman_notifier_connect() was called twice for each service, first in
READY state and then in LOGIN state. This broke refcounting in notifier.c
and caused a bug that Manager interface would always clame to be in
online state after a first successful connection even if all services were
disconnected.
__connman_service_auto_connect();
}
- if (state == CONNMAN_SERVICE_STATE_READY ||
- state == CONNMAN_SERVICE_STATE_ONLINE) {
+ if (state == CONNMAN_SERVICE_STATE_READY) {
set_reconnect_state(service, TRUE);
__connman_service_set_favorite(service, TRUE);