summaryrefslogtreecommitdiff
path: root/src/session.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-11-14 14:48:57 +0100
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2012-11-23 13:47:24 +0100
commitdde92b7fc8cf2c9bb3eed98deb3be0698315722c (patch)
tree039f339f1bab883ecec6c01f5f433b7379e4dc83 /src/session.c
parent562e35614eeb4fb6fde9347c34203e61315846a8 (diff)
downloadconnman-dde92b7fc8cf2c9bb3eed98deb3be0698315722c.tar.gz
connman-dde92b7fc8cf2c9bb3eed98deb3be0698315722c.tar.bz2
connman-dde92b7fc8cf2c9bb3eed98deb3be0698315722c.zip
session: Add destroy function for plugins
The error handling can get easily get pretty hairy, e.g. reallocating memory for allowed_bearers. If we hit this situation we allow the plugin to shutdown the session. That is consistent with what we do when there is a problem while creating a new session.
Diffstat (limited to 'src/session.c')
-rw-r--r--src/session.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/session.c b/src/session.c
index 68e35626..1287d198 100644
--- a/src/session.c
+++ b/src/session.c
@@ -1814,6 +1814,13 @@ err:
return err;
}
+void connman_session_destroy(struct connman_session *session)
+{
+ DBG("session %p", session);
+
+ session_disconnect(session);
+}
+
int __connman_session_destroy(DBusMessage *msg)
{
const char *owner, *session_path;
@@ -1835,7 +1842,7 @@ int __connman_session_destroy(DBusMessage *msg)
if (g_strcmp0(owner, session->owner) != 0)
return -EACCES;
- session_disconnect(session);
+ connman_session_destroy(session);
return 0;
}