summaryrefslogtreecommitdiff
path: root/obexd/client
diff options
context:
space:
mode:
Diffstat (limited to 'obexd/client')
-rw-r--r--obexd/client/session.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/obexd/client/session.c b/obexd/client/session.c
index 67c2b83fa..8138b1ecf 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
@@ -296,6 +296,16 @@ done:
g_free(callback);
}
+static void session_disconnected(GObex *obex, GError *err, gpointer user_data)
+{
+ struct obc_session *session = user_data;
+
+ if (err)
+ error("%s", err->message);
+
+ obc_session_shutdown(session);
+}
+
static void transport_func(GIOChannel *io, GError *err, gpointer user_data)
{
struct callback_data *callback = user_data;
@@ -345,6 +355,8 @@ static void transport_func(GIOChannel *io, GError *err, gpointer user_data)
session->obex = obex;
sessions = g_slist_prepend(sessions, session);
+ g_obex_set_disconnect_function(obex, session_disconnected, session);
+
return;
done:
callback->func(callback->session, NULL, err, callback->data);