summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-10-02 17:19:33 +0200
committerThomas Haller <thaller@redhat.com>2019-10-02 18:10:10 +0200
commitaa56482f90d5b4fa7aed99b49881b708a51a9c56 (patch)
treee3cdd67f1b13ba6c51b55bb335b9ef1fd63d1c36
parent3f8d58e55b982f27a48d3aef8afc5fe03f25c500 (diff)
downloadNetworkManager-th/libnm-deprecate-sync-api.tar.gz
libnm: deprecate nm_client_check_connectivity() in 1.22th/libnm-deprecate-sync-api
The previous commit marks all synchronous libnm API as deprecated. In practice, the macro _NM_DEPRECATED_SYNC_METHOD expands to nothing, because there is no immediate urgency to force users to migrate. However nm_client_check_connectivity() is especially bad: it makes a synchronous call and then updates the content of the cache artificially. Usually, NMClient's cache of D-Bus objects is only updated by "PropertiesChanged" D-Bus signals. nm_client_check_connectivity() instead will acts on the response to the "CheckConnectivity" D-Bus call -- a response that is picked out of order from the ordered sequence of messages -- and will update the cache instead of honoring the usual "PropertiesChanged" signal. I think such behavior is fundamentally broken. For a trivial property like NM_CLIENT_CONNECTIVITY such behavior is odd at best. Note how applying this approach to other functions (like nm_client_deactivate_connection(), which would affect a much larger state) would not be feasible. I also imagine it to be complicate to preserve this behavior when reworking libnm, as I plan to do.
-rw-r--r--libnm/nm-client.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libnm/nm-client.h b/libnm/nm-client.h
index 6e6d883e78..0b3b0e36e7 100644
--- a/libnm/nm-client.h
+++ b/libnm/nm-client.h
@@ -292,6 +292,7 @@ NMClientPermissionResult nm_client_get_permission_result (NMClient *client,
NMConnectivityState nm_client_get_connectivity (NMClient *client);
_NM_DEPRECATED_SYNC_METHOD
+NM_DEPRECATED_IN_1_22
NMConnectivityState nm_client_check_connectivity (NMClient *client,
GCancellable *cancellable,
GError **error);