From 9772b6702ee75f74e3ee78f7773d5c680950c948 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Mon, 9 May 2011 17:50:09 +0200 Subject: [PATCH] session: Pass on all service state changes All session should be informed that when there is service state change. For example, if one session calls Session.Connect() and the other session is only wants to free ride then it also needs to be informed (call session_changed). --- src/session.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/session.c b/src/session.c index b2d9d7e..df7d096 100644 --- a/src/session.c +++ b/src/session.c @@ -1411,8 +1411,7 @@ static void service_state_changed(struct connman_service *service, GHashTableIter iter; gpointer key, value; struct connman_session *session; - struct session_info *info; - connman_bool_t online; + struct session_info *info, *info_last; DBG("service %p state %d", service, state); @@ -1421,17 +1420,16 @@ static void service_state_changed(struct connman_service *service, while (g_hash_table_iter_next(&iter, &key, &value) == TRUE) { session = value; info = &session->info; + info_last = &session->info_last; if (info->service == service) { - online = __connman_service_is_connected(service); - if (info->online == online) - continue; - - info->online = online; - session->info_dirty = TRUE; - session_changed(session, - CONNMAN_SESSION_TRIGGER_SERVICE); + info->online = __connman_service_is_connected(service); + if (info_last->online != info->online) + session->info_dirty = TRUE; } + + session_changed(session, + CONNMAN_SESSION_TRIGGER_SERVICE); } } -- 2.7.4