From 23f91fd55e6519e9580ac86c70215969de28e4e9 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Thu, 11 Aug 2011 16:56:17 +0200 Subject: [PATCH] session: Handle configure state We should ignore service state (ASSOCIATION, CONFIGURATION) updates for connecting services (CONNMAN_SESSION_REASON_CONNECT). info->online will still be false for those services. So don't set the info->reason CONNMAN_SESSION_REASAON_FREE_RIDE. --- src/session.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/session.c b/src/session.c index fb12d3c..6126a91 100644 --- a/src/session.c +++ b/src/session.c @@ -752,6 +752,25 @@ static connman_bool_t is_connected(enum connman_service_state state) return FALSE; } +static connman_bool_t is_connecting(enum connman_service_state state) +{ + switch (state) { + case CONNMAN_SERVICE_STATE_UNKNOWN: + case CONNMAN_SERVICE_STATE_IDLE: + break; + case CONNMAN_SERVICE_STATE_ASSOCIATION: + case CONNMAN_SERVICE_STATE_CONFIGURATION: + return TRUE; + case CONNMAN_SERVICE_STATE_DISCONNECT: + case CONNMAN_SERVICE_STATE_FAILURE: + case CONNMAN_SERVICE_STATE_READY: + case CONNMAN_SERVICE_STATE_ONLINE: + break; + } + + return FALSE; +} + static connman_bool_t explicit_connect(enum connman_session_reason reason) { switch (reason) { @@ -922,6 +941,11 @@ static void session_changed(struct connman_session *session, if (info->online == TRUE) break; + if (info->entry != NULL && + is_connecting(info->entry->state) == TRUE) { + break; + } + if (info->stay_connected == TRUE) { DBG("StayConnected"); select_and_connect(session, -- 2.7.4