[gupnp-igd] gupnp-simple-igd: Check status of actual cancellable



commit a7c88d06beb9aab85a2e9c701e3244dc597a4f9d
Author: Olivier Crête <olivier crete collabora com>
Date:   Fri Sep 18 18:18:31 2020 -0400

    gupnp-simple-igd: Check status of actual cancellable
    
    It seems that sometimes GUPnP doesn't set the action as cancelled even
    if the cancellable has been cancelled. So in this case, just check it ourselves

 libgupnp-igd/gupnp-simple-igd.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/libgupnp-igd/gupnp-simple-igd.c b/libgupnp-igd/gupnp-simple-igd.c
index 1517981..e300d3e 100644
--- a/libgupnp-igd/gupnp-simple-igd.c
+++ b/libgupnp-igd/gupnp-simple-igd.c
@@ -813,6 +813,12 @@ _service_proxy_added_port_mapping (GObject *source_object, GAsyncResult *res,
   GUPnPSimpleIgd *self;
   GError *error = NULL;
 
+  /* This is a hack, but wek now that "res" is actually implemented as a GTask,
+   * we're just too lazy to carry our own reference counted structure
+   */
+  if (g_cancellable_is_cancelled (g_task_get_cancellable (G_TASK (res))))
+    return;
+
   action = gupnp_service_proxy_call_action_finish (proxy, res, &error);
 
   if (action == NULL &&


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]