summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2017-04-07 14:12:56 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2017-04-07 14:18:41 +0200
commitb1f2f3fd3e9aa00271943d1615e0702b2c6540c7 (patch)
treeadcc07031fe5eddd6f52ff08456ce91e137baee1
parent0155757d84bf50479b46176307e88d7b7f269d06 (diff)
downloadNetworkManager-bg/pacrunner-fix.tar.gz
pacrunner: remove failed and pending items from configuration listbg/pacrunner-fix
If a configuration does not have a path it is because we are still sending it to pacrunner or because we failed to do so. In both cases, we have to remove the configuration from the list. Fixes: 3ad89223d0ea9a772b650842d15583d92cf9a904
-rw-r--r--src/nm-pacrunner-manager.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/nm-pacrunner-manager.c b/src/nm-pacrunner-manager.c
index 88d82602ef..d4a5b5ab9a 100644
--- a/src/nm-pacrunner-manager.c
+++ b/src/nm-pacrunner-manager.c
@@ -458,21 +458,22 @@ nm_pacrunner_manager_remove (NMPacrunnerManager *self, const char *tag)
if (nm_streq (config->tag, tag)) {
if (priv->pacrunner) {
if (!config->path) {
- /* send() is pending: mark the config as removed
- * so that the send() callback will remove it when
- * the D-Bus path is known. */
+ /* send() failed or is still pending. Mark the item as
+ * removed, so that we ask pacrunner to drop it when the
+ * send() completes.
+ */
config->removed = TRUE;
config_unref (config);
- return;
+ } else {
+ g_dbus_proxy_call (priv->pacrunner,
+ "DestroyProxyConfiguration",
+ g_variant_new ("(o)", config->path),
+ G_DBUS_CALL_FLAGS_NO_AUTO_START,
+ -1,
+ priv->pacrunner_cancellable,
+ (GAsyncReadyCallback) pacrunner_remove_done,
+ config);
}
- g_dbus_proxy_call (priv->pacrunner,
- "DestroyProxyConfiguration",
- g_variant_new ("(o)", config->path),
- G_DBUS_CALL_FLAGS_NO_AUTO_START,
- -1,
- priv->pacrunner_cancellable,
- (GAsyncReadyCallback) pacrunner_remove_done,
- config);
} else
config_unref (config);
priv->configs = g_list_delete_link (priv->configs, list);