summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2013-05-31 07:13:26 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-05-31 11:35:44 (GMT)
commite329cc8a43726a8e45b8f97d20f90d8782b40d0f (patch)
treef5c0ad93dd391080aaa97e4119677078373c1851
parent32a8cf5a3ec6731b6adaa6fd061d08124427db5e (diff)
downloadconnman-e329cc8a43726a8e45b8f97d20f90d8782b40d0f.zip
connman-e329cc8a43726a8e45b8f97d20f90d8782b40d0f.tar.gz
connman-e329cc8a43726a8e45b8f97d20f90d8782b40d0f.tar.bz2
session: Add session argument to create_service_entry_cb
Remember which session this struct service_entry belongs to when removing the entries again.
-rw-r--r--src/connman.h1
-rw-r--r--src/service.c4
-rw-r--r--src/session.c8
3 files changed, 9 insertions, 4 deletions
diff --git a/src/connman.h b/src/connman.h
index 1e6bfec..f4de887 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -714,6 +714,7 @@ struct service_entry;
typedef connman_bool_t (* service_match_cb) (struct connman_session *session,
struct connman_service *service);
typedef struct service_entry* (* create_service_entry_cb) (
+ struct connman_session *session,
struct connman_service *service,
const char *name,
enum connman_service_state state);
diff --git a/src/service.c b/src/service.c
index af8bfce..3d03b2c 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2145,8 +2145,8 @@ GSequence *__connman_service_get_list(struct connman_session *session,
service = g_sequence_get(iter);
if (service_match(session, service) == TRUE) {
- entry = create_service_entry(service, service->name,
- service->state);
+ entry = create_service_entry(session, service,
+ service->name, service->state);
if (entry == NULL)
return list;
diff --git a/src/session.c b/src/session.c
index e5d8d85..0ac73c7 100644
--- a/src/session.c
+++ b/src/session.c
@@ -60,6 +60,7 @@ enum connman_session_state {
};
struct service_entry {
+ struct connman_session *session;
/* track why this service was selected */
enum connman_session_reason reason;
enum connman_service_state state;
@@ -1206,7 +1207,8 @@ static void select_and_connect(struct connman_session *session,
}
}
-static struct service_entry *create_service_entry(struct connman_service *service,
+static struct service_entry *create_service_entry(struct connman_session * session,
+ struct connman_service *service,
const char *name,
enum connman_service_state state)
{
@@ -1234,6 +1236,8 @@ static struct service_entry *create_service_entry(struct connman_service *servic
type = connman_service_get_type(entry->service);
entry->bearer = service2bearer(type);
+ entry->session = session;
+
return entry;
}
@@ -1939,7 +1943,7 @@ static void service_add(struct connman_service *service,
if (service_match(session, service) == FALSE)
continue;
- entry = create_service_entry(service, name,
+ entry = create_service_entry(session, service, name,
CONNMAN_SERVICE_STATE_IDLE);
if (entry == NULL)
continue;