[gupnp/gupnp-1.4] ServiceProxy: Do not return GTask twice



commit 2e4d60c26a84a59f4aff5ac33db929f93b48e511
Author: Jens Georg <mail jensge org>
Date:   Sat Jan 8 10:39:03 2022 +0100

    ServiceProxy: Do not return GTask twice
    
    Fixes a critical if there was a transport error

 libgupnp/gupnp-service-proxy.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c
index 96fafd7..3d34cec 100644
--- a/libgupnp/gupnp-service-proxy.c
+++ b/libgupnp/gupnp-service-proxy.c
@@ -752,22 +752,15 @@ action_task_got_response (SoupSession *session,
                         GUPNP_SERVER_ERROR,
                         GUPNP_SERVER_ERROR_OTHER,
                         "Server does not allow any POST messages");
-        }
-
-        switch (msg->status_code) {
-        case SOUP_STATUS_CANCELLED:
+        } else if (msg->status_code == SOUP_STATUS_CANCELLED) {
                 g_task_return_new_error (task,
                                          G_IO_ERROR,
                                          G_IO_ERROR_CANCELLED,
                                          "Action message was cancelled");
-                break;
-        default:
+        } else {
                 g_task_return_pointer (task,
                                        g_task_get_task_data (task),
                                        NULL);
-
-
-                break;
         }
 
         g_object_unref (task);


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