From 728983ff6cd60fb9a827d76dbbc77f65c66783b3 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Wed, 31 Oct 2012 10:33:27 +0100 Subject: [PATCH] manager: Allow async CreateSession method call The CreateSession D-Bus call should be marked as async call in order to allow the session core to defer the response. --- src/manager.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/manager.c b/src/manager.c index 205359a..d4f8c3d 100644 --- a/src/manager.c +++ b/src/manager.c @@ -338,8 +338,12 @@ static DBusMessage *create_session(DBusConnection *conn, DBG("conn %p", conn); err = __connman_session_create(msg); - if (err < 0) + if (err < 0) { + if (err == -EINPROGRESS) + return NULL; + return __connman_error_failed(msg, -err); + } return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); } @@ -426,7 +430,7 @@ static const GDBusMethodTable manager_methods[] = { { GDBUS_METHOD("UnregisterCounter", GDBUS_ARGS({ "path", "o" }), NULL, unregister_counter) }, - { GDBUS_METHOD("CreateSession", + { GDBUS_ASYNC_METHOD("CreateSession", GDBUS_ARGS({ "settings", "a{sv}" }, { "notifier", "o" }), GDBUS_ARGS({ "session", "o" }), -- 2.7.4