act-request: allow omitting the @self argument in nm_act_request_cancel_secrets()

Previously, we would require a @self argument and the @call_id in
nm_act_request_cancel_secrets(), although the @call_id already has
a pointer to @self.
In principle that is not necessary, but it makes the API a bit
more robust as you need to care about the lifetime of the @req
as well.

However it is a bit inconvenient, because it requires that caller to
track both the activation request and the call-id.

Now, allow nm_act_request_get_secrets() to instruct the call-id to
take an additional reference to @self. Later on, we would allow to omit
the argument during cancelling. We only allow this, if the call-id
takes a reference to @self.
This commit is contained in:
Thomas Haller
2016-12-16 13:06:19 +01:00
parent 3b95cf68e2
commit bd89c8a924
6 changed files with 37 additions and 6 deletions

View File

@@ -63,6 +63,7 @@ typedef void (*NMActRequestSecretsFunc) (NMActRequest *req,
gpointer user_data);
NMActRequestGetSecretsCallId nm_act_request_get_secrets (NMActRequest *req,
gboolean take_ref,
const char *setting_name,
NMSecretAgentGetSecretsFlags flags,
const char *hint,