[jsonrpc-glib] client: allow panic to error the in-flight task



commit 3ec74a7049673657a6d479a93b11ddcca29a0d2a
Author: Christian Hergert <chergert redhat com>
Date:   Mon Feb 19 13:46:58 2018 -0800

    client: allow panic to error the in-flight task
    
    This just makes more places for us to return the task, so it's cleaner to
    handle everything from the panic state (and ensures we return from the
    main loop rather than this errored path).

 src/jsonrpc-client.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/src/jsonrpc-client.c b/src/jsonrpc-client.c
index 5da8d99..fc08f0f 100644
--- a/src/jsonrpc-client.c
+++ b/src/jsonrpc-client.c
@@ -618,9 +618,8 @@ jsonrpc_client_call_write_cb (GObject      *object,
 
   if (!jsonrpc_output_stream_write_message_finish (stream, result, &error))
     {
-      jsonrpc_client_remove_from_invocations (self, task);
+      /* Panic will cancel our task, no need to return error here */
       jsonrpc_client_panic (self, error);
-      g_task_return_error (task, g_steal_pointer (&error));
       return;
     }
 


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