session: Track application connect/disconnect state
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Tue, 12 Apr 2011 06:53:35 +0000 (08:53 +0200)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Tue, 12 Apr 2011 13:27:43 +0000 (15:27 +0200)
src/session.c

index 43f9b7a..c4edfd4 100644 (file)
@@ -50,6 +50,7 @@ struct connman_session {
        char *bearer;
        const char *name;
        char *ifname;
+       connman_bool_t connect;
        connman_bool_t online;
        connman_bool_t priority;
        GSList *allowed_bearers;
@@ -712,6 +713,8 @@ static DBusMessage *connect_session(DBusConnection *conn,
 
        DBG("session %p", session);
 
+       session->connect = TRUE;
+
        if (session->service_list != NULL)
                g_sequence_free(session->service_list);
 
@@ -772,6 +775,8 @@ static DBusMessage *disconnect_session(DBusConnection *conn,
 
        DBG("session %p", session);
 
+       session->connect = FALSE;
+
        if (session->service == NULL)
                return __connman_error_already_disabled(msg);