From b1f2f3fd3e9aa00271943d1615e0702b2c6540c7 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 7 Apr 2017 14:12:56 +0200 Subject: pacrunner: remove failed and pending items from configuration list 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 --- src/nm-pacrunner-manager.c | 25 +++++++++++++------------ 1 file 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); -- cgit v1.2.1