Call __connman_notifier_connect() only when state is READY
authorMartin Xu <martin.xu@intel.com>
Wed, 5 May 2010 15:26:59 +0000 (23:26 +0800)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 6 May 2010 05:39:56 +0000 (07:39 +0200)
commitbd430d3a5c81c4c471c2846cc919da4ef5aa0f5d
tree4584aa147ce10a9fa48f6a6f759931450fa66aba
parent8638482857d6eead3ccbfb8f64471f62dfc1643f
Call __connman_notifier_connect() only when state is READY

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.
src/service.c