summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2013-05-31 07:13:31 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-05-31 11:39:56 (GMT)
commitf75c7928550ea4c29207143765ba06101d67d866 (patch)
tree07db2862cec7732f13ff76b77c3237f7a8ea51d9 /plugins
parent61ed5e2bd527eb2631b365123462503cfe6952fb (diff)
downloadconnman-f75c7928550ea4c29207143765ba06101d67d866.zip
connman-f75c7928550ea4c29207143765ba06101d67d866.tar.gz
connman-f75c7928550ea4c29207143765ba06101d67d866.tar.bz2
session_policy_local: Add some more debug information
Diffstat (limited to 'plugins')
-rw-r--r--plugins/session_policy_local.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/plugins/session_policy_local.c b/plugins/session_policy_local.c
index 33152ab..6cd876c 100644
--- a/plugins/session_policy_local.c
+++ b/plugins/session_policy_local.c
@@ -65,6 +65,8 @@ static void cleanup_policy(gpointer user_data)
{
struct policy_data *policy = user_data;
+ DBG("policy %p", policy);
+
if (policy->config != NULL)
g_slist_free(policy->config->allowed_bearers);
@@ -118,6 +120,8 @@ static struct policy_data *create_policy(const char *ident)
policy = g_new0(struct policy_data, 1);
policy->refcount = 1;
+ DBG("policy %p", policy);
+
policy->config = connman_session_create_default_config();
policy->ident = g_strdup(ident);
@@ -339,18 +343,22 @@ static int load_policy(struct policy_data *policy)
return err;
}
-static void update_session(struct connman_session *session)
+static void update_session(struct policy_data *policy)
{
- if (connman_session_config_update(session) < 0)
- connman_session_destroy(session);
+ DBG("policy %p session %p", policy, policy->session);
+
+ if (policy->session == NULL)
+ return;
+
+ if (connman_session_config_update(policy->session) < 0)
+ connman_session_destroy(policy->session);
}
static void remove_policy(struct policy_data *policy)
{
- if (policy->session != NULL) {
+ if (policy->session != NULL)
connman_session_set_default_config(policy->config);
- update_session(policy->session);
- }
+ update_session(policy);
policy_unref(policy);
}
@@ -403,8 +411,7 @@ static void notify_handler(struct inotify_event *event,
return;
}
- if (policy->session != NULL)
- update_session(policy->session);
+ update_session(policy);
}
static int read_policies(void)
@@ -437,6 +444,8 @@ static int session_policy_local_init(void)
{
int err;
+ DBG("");
+
/* If the dir doesn't exist, create it */
if (g_file_test(POLICYDIR, G_FILE_TEST_IS_DIR) == FALSE) {
if (mkdir(POLICYDIR, MODE) < 0) {
@@ -487,6 +496,8 @@ err:
static void session_policy_local_exit(void)
{
+ DBG("");
+
g_hash_table_destroy(session_hash);
g_hash_table_destroy(policy_hash);