[gupnp] service-proxy: Do not call-back cancelled action



commit 0648399acb989473119fe59d0b9f65c923e69483
Author: Jens Georg <mail jensge org>
Date:   Mon Mar 18 23:01:16 2019 +0100

    service-proxy: Do not call-back cancelled action
    
    This is for the old-style API which wasn't doing that in 1.0. Fixes
    breaking the gupnp-igd tests

 libgupnp/gupnp-service-proxy.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c
index 78c3354..7a83705 100644
--- a/libgupnp/gupnp-service-proxy.c
+++ b/libgupnp/gupnp-service-proxy.c
@@ -547,7 +547,10 @@ on_legacy_async_callback (GObject *source, GAsyncResult *res, gpointer user_data
 
         gupnp_service_proxy_call_action_finish (GUPNP_SERVICE_PROXY (source), res, &error);
         action = (GUPnPServiceProxyAction *) user_data;
-        if (action->callback != NULL)
+
+        /* Do not perform legacy call-back if action is cancelled, to comply with the old implementation */
+        if (action->callback != NULL &&
+            !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
                 action->callback (action->proxy, action, action->user_data);
 }
 


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