[PATCH] mbimcli: wire up cancellable for query-ip-configuration action

Ben Chan benchan at chromium.org
Wed Jul 26 07:35:58 UTC 2017


---
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.

Ben

 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;
     }
 
-- 
2.14.0.rc0.400.g1c36432dff-goog



More information about the libmbim-devel mailing list