[PATCH] mbimcli: wire up cancellable for query-ip-configuration action
Aleksander Morgado
aleksander at aleksander.es
Wed Jul 26 10:15:19 UTC 2017
On 26/07/17 09:35, Ben Chan wrote:
> ---
> It seems like ip_configuration_query could take some time, so we may want to
> cancel the action. If this patch makes sense, I can also wire up the case when
> ip_configuration_query is called from connect_ready.
>
Pushed to git master, thanks.
It shouldn't harm if we also wire up the cancellable during the IP configuration query done in connect_ready(), yes.
>
> src/mbimcli/mbimcli-basic-connect.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/src/mbimcli/mbimcli-basic-connect.c b/src/mbimcli/mbimcli-basic-connect.c
> index e1d40d1..e12b375 100644
> --- a/src/mbimcli/mbimcli-basic-connect.c
> +++ b/src/mbimcli/mbimcli-basic-connect.c
> @@ -736,6 +736,7 @@ ip_configuration_query_ready (MbimDevice *device,
>
> static void
> ip_configuration_query (MbimDevice *device,
> + GCancellable *cancellable,
> guint session_id)
> {
> MbimMessage *message;
> @@ -769,7 +770,7 @@ ip_configuration_query (MbimDevice *device,
> mbim_device_command (device,
> message,
> 60,
> - NULL,
> + cancellable,
> (GAsyncReadyCallback)ip_configuration_query_ready,
> NULL);
> mbim_message_unref (message);
> @@ -844,7 +845,7 @@ connect_ready (MbimDevice *device,
> VALIDATE_UNKNOWN (mbim_nw_error_get_string (nw_error)));
>
> if (GPOINTER_TO_UINT (user_data) == CONNECT) {
> - ip_configuration_query (device, session_id);
> + ip_configuration_query (device, NULL, session_id);
> return;
> }
>
> @@ -1986,7 +1987,7 @@ mbimcli_basic_connect_run (MbimDevice *device,
> return;
> }
>
> - ip_configuration_query (ctx->device, session_id);
> + ip_configuration_query (ctx->device, ctx->cancellable, session_id);
> return;
> }
>
>
--
Aleksander
https://aleksander.es
More information about the libmbim-devel
mailing list