summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-08-22 13:37:08 +0200
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2011-08-23 17:22:29 +0200
commit1d66ff795f047f236b0f31730e4e172cfb62a71a (patch)
treeaa5cf325c123c1ad7ad1154a06413f991c5295a5
parent9eee483dabf7dd11731112e40ad0e2ab5d9e9415 (diff)
downloadconnman-1d66ff795f047f236b0f31730e4e172cfb62a71a.tar.gz
connman-1d66ff795f047f236b0f31730e4e172cfb62a71a.tar.bz2
connman-1d66ff795f047f236b0f31730e4e172cfb62a71a.zip
session: Don't change ref count if reason code is set.
If the reason code has been set the proper action has been executed already.
-rw-r--r--src/session.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/session.c b/src/session.c
index 1baf059a..f0b6a207 100644
--- a/src/session.c
+++ b/src/session.c
@@ -738,6 +738,9 @@ static connman_bool_t explicit_disconnect(struct connman_session *session)
session, reason2string(info->entry->reason),
info->entry->service, info->entry->state);
+ if (info->entry->reason == CONNMAN_SESSION_REASON_UNKNOWN)
+ return FALSE;
+
if (explicit_connect(info->entry->reason) == FALSE)
return FALSE;
@@ -873,6 +876,8 @@ static void session_changed(struct connman_session *session,
break;
case CONNMAN_SESSION_TRIGGER_CONNECT:
if (info->online == TRUE) {
+ if (info->entry->reason == CONNMAN_SESSION_REASON_CONNECT)
+ break;
info->entry->reason = CONNMAN_SESSION_REASON_CONNECT;
__connman_service_session_inc(info->entry->service);
break;