[evolution] network-manager: Recover from dropped D-Bus connections faster



commit 42b4f85ec5263c1715f5dfd01d0f3c289b8a9c68
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Jul 7 13:46:13 2011 -0400

    network-manager: Recover from dropped D-Bus connections faster

 .../network-manager/evolution-network-manager.c    |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/modules/network-manager/evolution-network-manager.c b/modules/network-manager/evolution-network-manager.c
index f1ab785..1398478 100644
--- a/modules/network-manager/evolution-network-manager.c
+++ b/modules/network-manager/evolution-network-manager.c
@@ -70,16 +70,24 @@ network_manager_get_shell (ENetworkManager *extension)
 }
 
 static void
-nm_connection_closed_cb (GDBusConnection *pconnection,
+nm_connection_closed_cb (GDBusConnection *connection,
                          gboolean remote_peer_vanished,
                          GError *error,
                          ENetworkManager *extension)
 {
+	gboolean try_again;
+
 	g_object_unref (extension->connection);
 	extension->connection = NULL;
 
-	g_timeout_add_seconds (
-		3, (GSourceFunc) network_manager_connect, extension);
+	/* Try connecting to the session bus immediately, and then
+	 * keep trying at 3 second intervals until we're back on. */
+
+	try_again = network_manager_connect (extension);
+
+	if (try_again)
+		g_timeout_add_seconds (
+			3, (GSourceFunc) network_manager_connect, extension);
 }
 
 static void



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