G_LOCK (message_bus_lock);
CONNECTION_LOCK (connection);
- if (connection->worker != NULL)
+
+ if (connection->kdbus_worker != NULL)
+ {
+ g_kdbus_worker_stop (connection->kdbus_worker);
+ connection->kdbus_worker = NULL;
+ if (alive_connections != NULL)
+ g_warn_if_fail (g_hash_table_remove (alive_connections, connection));
+ }
+ else if (connection->worker != NULL)
{
_g_dbus_worker_stop (connection->worker);
connection->worker = NULL;
if (!check_unclosed (connection, 0, error))
goto out;
- if (connection->kdbus_worker)
+ if (connection->kdbus_worker != NULL)
{
+ g_kdbus_worker_flush_sync (connection->kdbus_worker);
ret = TRUE;
- goto out;
}
-
- g_assert (connection->worker != NULL);
-
- ret = _g_dbus_worker_flush_sync (connection->worker,
- cancellable,
- error);
+ else if (connection->worker != NULL)
+ {
+ ret = _g_dbus_worker_flush_sync (connection->worker,
+ cancellable,
+ error);
+ }
+ else
+ g_assert_not_reached();
out:
return ret;
g_dbus_message_set_serial (message, serial);
g_dbus_message_set_message_type (message, type);
- //if (g_dbus_message_get_header (message, G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE) != NULL)
- // {
+ if (g_dbus_message_get_header (message, G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE) != NULL)
+ {
body = g_variant_get_variant (parts[1]);
g_dbus_message_set_body (message, body);
g_variant_unref (body);
- // }
+ }
g_variant_unref (parts[1]);
//g_print ("Received:\n%s\n", g_dbus_message_print (message, 2));
return _g_kdbus_send (worker, message, error);
}
+/* TODO */
void
-g_kdbus_worker_stop (GKDBusWorker *worker)
+g_kdbus_worker_flush_sync (GKDBusWorker *worker)
{
+ g_warning ("TODO: Implement sync flush");
}
void
-g_kdbus_worker_flush_sync (GKDBusWorker *worker)
+g_kdbus_worker_stop (GKDBusWorker *worker)
{
+ g_warning ("TODO: Implement worker stop");
}
void