[kdbus] Do not set body message if signature field is empty
authorLukasz Skalski <l.skalski@samsung.com>
Tue, 5 May 2015 14:44:09 +0000 (14:44 +0000)
committerMaciej Wereski <m.wereski@partner.samsung.com>
Fri, 10 Jul 2015 09:47:45 +0000 (11:47 +0200)
gio/gdbusconnection.c
gio/gkdbus.c

index 5e1f0a1..a776ae9 100644 (file)
@@ -629,7 +629,15 @@ g_dbus_connection_dispose (GObject *object)
 
   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;
@@ -1353,17 +1361,19 @@ g_dbus_connection_flush_sync (GDBusConnection  *connection,
   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;
index 0bb5766..dcaf2a1 100644 (file)
@@ -2162,12 +2162,12 @@ g_kdbus_decode_dbus_msg (GKDBusWorker           *worker,
   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));
@@ -2747,14 +2747,17 @@ g_kdbus_worker_send_message (GKDBusWorker  *worker,
   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