[gvfs/gdbus] gdbus: Flush the async metadata calls



commit a541205d83d7a66cb37d2c797aa78a0e258fc4e6
Author: Tomas Bzatek <tbzatek redhat com>
Date:   Wed May 30 18:57:38 2012 +0200

    gdbus: Flush the async metadata calls
    
    Otherwise it would not be guaranteed that the messages got actually
    sent if a program exits afterwards.
    
    Synchronously flushing queued messages on a shared GDBusConnection
    is quite risky as the queue could be rather long and we would block,
    however the affected calls are not that common in normal use.

 client/gdaemonvfs.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index 1961dd7..33c218a 100644
--- a/client/gdaemonvfs.c
+++ b/client/gdaemonvfs.c
@@ -1480,6 +1480,9 @@ g_daemon_vfs_local_file_removed (GVfs       *vfs,
                                      NULL,
                                      NULL, /* callback */
                                      NULL);
+          /* flush the call with the expense of sending all queued messages on the connection */
+          g_dbus_connection_flush_sync (g_dbus_proxy_get_connection (G_DBUS_PROXY (proxy)),
+                                        NULL, NULL);
         }
       
       meta_tree_unref (tree);
@@ -1525,6 +1528,9 @@ g_daemon_vfs_local_file_moved (GVfs       *vfs,
                                    NULL,
                                    NULL, /* callback */
                                    NULL);
+          /* flush the call with the expense of sending all queued messages on the connection */
+          g_dbus_connection_flush_sync (g_dbus_proxy_get_connection (G_DBUS_PROXY (proxy)),
+                                        NULL, NULL);
         }
     }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]