Commit 019b9fbf authored by Thomas Haller's avatar Thomas Haller

proxy: send proxy config after creating D-Bus proxy

As NMDevice now creates the NMPacrunnerManager instance
as needed, it is even more likely that the initial call
to nm_pacrunner_manager_send() will only queue (but not yet
send) the new config.

Later, when the D-Bus proxy is created, we will not get a
name-owner changed signal. We instead have to push the configuration
right away.
parent 8c81a4b5
......@@ -286,16 +286,13 @@ pacrunner_send_config (NMPacrunnerManager *self, Config *config)
}
static void
name_owner_changed (GObject *object,
GParamSpec *pspec,
gpointer user_data)
name_owner_changed (NMPacrunnerManager *self)
{
NMPacrunnerManager *self = NM_PACRUNNER_MANAGER (user_data);
NMPacrunnerManagerPrivate *priv = NM_PACRUNNER_MANAGER_GET_PRIVATE (self);
gs_free char *owner = NULL;
GList *iter = NULL;
owner = g_dbus_proxy_get_name_owner (G_DBUS_PROXY (object));
owner = g_dbus_proxy_get_name_owner (priv->pacrunner);
if (owner) {
_LOGD ("name owner appeared (%s)", owner);
for (iter = g_list_first (priv->configs); iter; iter = g_list_next (iter))
......@@ -305,6 +302,14 @@ name_owner_changed (GObject *object,
}
}
static void
name_owner_changed_cb (GObject *object,
GParamSpec *pspec,
gpointer user_data)
{
name_owner_changed (user_data);
}
static void
pacrunner_proxy_cb (GObject *source, GAsyncResult *res, gpointer user_data)
{
......@@ -327,7 +332,8 @@ pacrunner_proxy_cb (GObject *source, GAsyncResult *res, gpointer user_data)
nm_clear_g_cancellable (&priv->pacrunner_cancellable);
g_signal_connect (priv->pacrunner, "notify::g-name-owner",
G_CALLBACK (name_owner_changed), self);
G_CALLBACK (name_owner_changed_cb), self);
name_owner_changed (self);
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment