diff options
author | Thomas Haller <thaller@redhat.com> | 2018-04-09 13:27:03 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-04-13 09:09:46 +0200 |
commit | 2ea2df3184d45567fa9c44f5ef90634a779bfb75 (patch) | |
tree | 193f86d47cb4e6f467f0d914766f11a3cafa4347 /config.h.meson | |
parent | 999594a56f86cfd2f6383bd223c03445b0e2e561 (diff) | |
download | NetworkManager-2ea2df3184d45567fa9c44f5ef90634a779bfb75.tar.gz |
auth-manager: rework auth-manager's API
Don't use the GAsyncResult pattern for internal API of auth-manager. Instead,
use a simpler API that has a more strict API and simpler use.
- return a call-id handle when scheduling the authorization request.
The request is always scheduled asynchronsously and thus call-id
is never %NULL.
- the call-id can be used to cancel the request. It can be used exactly
once, and only before the callback is invoked.
- the async keeps the auth-manager alive. It needs to do so, because
when cancelling the request we might not yet be done: instead we
might still need to issue a CancelCheckAuthorization call (which
we need to handle as well).
- the callback is always invoked exactly once.
Currently NMAuthManager's API effectivly is only called by NMAuthChain.
The point of this is to make NMAuthManager's API more consumable, and
thus let users use it directly (instead of using the NMAuthChain layer).
As well known, we don't do a good job during shutdown of NetworkManager
to release all resources and cancel pending requests. This rework also
makes it possible to actually get this right. See the comment in
nm_auth_manager_force_shutdown(). But yes, it is still a bit complicated
to do a controlled shutdown, because we cannot just synchronously
complete. We need to issue CancelCheckAuthorization D-Bus calls, and
give these requests time to complete. The new API introduced by this patch
would make that easier.
Diffstat (limited to 'config.h.meson')
0 files changed, 0 insertions, 0 deletions