Hello community, here is the log from the commit of package jsonrpc-glib for openSUSE:Factory checked in at 2018-06-22 13:28:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/jsonrpc-glib (Old) and /work/SRC/openSUSE:Factory/.jsonrpc-glib.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "jsonrpc-glib" Fri Jun 22 13:28:33 2018 rev:5 rq:617887 version:3.28.1 Changes: -------- --- /work/SRC/openSUSE:Factory/jsonrpc-glib/jsonrpc-glib.changes 2018-03-14 19:33:11.781650709 +0100 +++ /work/SRC/openSUSE:Factory/.jsonrpc-glib.new/jsonrpc-glib.changes 2018-06-22 13:28:34.793738834 +0200 @@ -1,0 +2,9 @@ +Tue Jun 19 16:50:05 UTC 2018 - [email protected] + +- Update to version 3.28.1: + + Fixes for invalid type propagation. + + Fixes for gobject introspection. + + Improved busy tracking in streams. + + Ensure JsonrpcClient::failed is emitted in panic. + +------------------------------------------------------------------- Old: ---- jsonrpc-glib-3.28.0.tar.xz New: ---- jsonrpc-glib-3.28.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ jsonrpc-glib.spec ++++++ --- /var/tmp/diff_new_pack.xub54Y/_old 2018-06-22 13:28:35.361717842 +0200 +++ /var/tmp/diff_new_pack.xub54Y/_new 2018-06-22 13:28:35.365717694 +0200 @@ -18,13 +18,14 @@ %define sover 1_0-1 Name: jsonrpc-glib -Version: 3.28.0 +Version: 3.28.1 Release: 0 Summary: Library to communicate with JSON-RPC based peers License: LGPL-2.1-or-later Group: Development/Libraries/GNOME URL: https://gitlab.gnome.org/GNOME/jsonrpc-glib Source: http://download.gnome.org/sources/jsonrpc-glib/3.28/%{name}-%{version}.tar.xz + BuildRequires: gtk-doc BuildRequires: meson >= 0.40.1 BuildRequires: pkgconfig ++++++ jsonrpc-glib-3.28.0.tar.xz -> jsonrpc-glib-3.28.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonrpc-glib-3.28.0/NEWS new/jsonrpc-glib-3.28.1/NEWS --- old/jsonrpc-glib-3.28.0/NEWS 2018-03-14 01:07:21.000000000 +0100 +++ new/jsonrpc-glib-3.28.1/NEWS 2018-06-19 05:04:45.000000000 +0200 @@ -1,4 +1,13 @@ ============== +Version 3.28.1 +============== + + • Fixes for invalid type propagation + • Fixes for gobject introspection + • Improved busy tracking in streams + • Ensure JsonrpcClient::failed is emitted in panic + +============== Version 3.28.0 ============== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonrpc-glib-3.28.0/meson.build new/jsonrpc-glib-3.28.1/meson.build --- old/jsonrpc-glib-3.28.0/meson.build 2018-03-14 01:07:21.000000000 +0100 +++ new/jsonrpc-glib-3.28.1/meson.build 2018-06-19 05:04:45.000000000 +0200 @@ -1,5 +1,5 @@ project('jsonrpc-glib', 'c', - version: '3.28.0', + version: '3.28.1', license: 'LGPLv2.1+', meson_version: '>= 0.40.1', default_options: [ 'warning_level=1', 'buildtype=debugoptimized', 'c_std=gnu11' ], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonrpc-glib-3.28.0/src/jsonrpc-client.c new/jsonrpc-glib-3.28.1/src/jsonrpc-client.c --- old/jsonrpc-glib-3.28.0/src/jsonrpc-client.c 2018-03-14 01:07:21.000000000 +0100 +++ new/jsonrpc-glib-3.28.1/src/jsonrpc-client.c 2018-06-19 05:04:45.000000000 +0200 @@ -128,6 +128,12 @@ guint failed : 1; /* + * Only set once we've emitted the ::failed signal (so we only do that + * a single time). + */ + guint emitted_failed : 1; + + /* * If we should try to use gvariant encoding when communicating with * our peer. This is helpful to be able to lower parser and memory * overhead. @@ -266,6 +272,22 @@ priv->invocations = g_hash_table_new_full (NULL, NULL, NULL, g_object_unref); } +static gboolean +emit_failed_from_main (JsonrpcClient *self) +{ + JsonrpcClientPrivate *priv = jsonrpc_client_get_instance_private (self); + + g_assert (JSONRPC_IS_CLIENT (self)); + + if (!priv->emitted_failed) + { + priv->emitted_failed = TRUE; + g_signal_emit (self, signals [FAILED], 0); + } + + return G_SOURCE_REMOVE; +} + /* * jsonrpc_client_panic: * @@ -297,6 +319,16 @@ */ g_clear_object (&priv->input_stream); g_clear_object (&priv->output_stream); + + /* + * Queue a "failed" signal from a main loop callback so that we don't + * get the client into weird stuff from signal callbacks here. + */ + if (!priv->emitted_failed) + g_idle_add_full (G_MAXINT, + (GSourceFunc)emit_failed_from_main, + g_object_ref (self), + g_object_unref); } /* @@ -847,7 +879,7 @@ * @method: the name of the method to call * @params: (transfer none) (nullable): A #GVariant of parameters or %NULL * @cancellable: (nullable): A #GCancellable or %NULL - * @return_value: (nullable) (out): A location for a #JsonNode. + * @return_value: (nullable) (out): A location for a #GVariant. * * Synchronously calls @method with @params on the remote peer. * @@ -906,7 +938,7 @@ * jsonrpc_client_call_async: * @self: A #JsonrpcClient * @method: the name of the method to call - * @params: (transfer none) (nullable): A #JsonNode of parameters or %NULL + * @params: (transfer none) (nullable): A #GVariant of parameters or %NULL * @cancellable: (nullable): A #GCancellable or %NULL * @callback: a callback to executed upon completion * @user_data: user data for @callback @@ -987,7 +1019,7 @@ * jsonrpc_client_call_finish: * @self: A #JsonrpcClient. * @result: A #GAsyncResult provided to the callback in jsonrpc_client_call_async() - * @return_value: (out) (nullable): A location for a #JsonNode or %NULL + * @return_value: (out) (nullable): A location for a #GVariant or %NULL * @error: a location for a #GError or %NULL * * Completes an asynchronous call to jsonrpc_client_call_async(). @@ -1002,7 +1034,7 @@ GVariant **return_value, GError **error) { - g_autoptr(JsonNode) local_return_value = NULL; + g_autoptr(GVariant) local_return_value = NULL; gboolean ret; g_return_val_if_fail (JSONRPC_IS_CLIENT (self), FALSE); @@ -1230,7 +1262,7 @@ "The underlying stream was closed"); cancel_pending_from_main (self, local_error); - g_signal_emit (self, signals [FAILED], 0); + emit_failed_from_main (self); return ret; } @@ -1395,7 +1427,7 @@ * jsonrpc_client_reply: * @self: a #JsonrpcClient * @id: (transfer none) (not nullable): the id of the message to reply - * result: (transfer none) (nullable): the return value or %NULL + * @result: (transfer none) (nullable): the return value or %NULL * @cancellable: (nullable): a #GCancellable, or %NULL * @error: a #GError, or %NULL * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonrpc-glib-3.28.0/src/jsonrpc-input-stream.c new/jsonrpc-glib-3.28.1/src/jsonrpc-input-stream.c --- old/jsonrpc-glib-3.28.0/src/jsonrpc-input-stream.c 2018-03-14 01:07:21.000000000 +0100 +++ new/jsonrpc-glib-3.28.1/src/jsonrpc-input-stream.c 2018-06-19 05:04:45.000000000 +0200 @@ -130,6 +130,12 @@ g_free, state->buffer); state->buffer = NULL; + + if G_UNLIKELY (jsonrpc_input_stream_debug && state->use_gvariant) + { + g_autofree gchar *debugstr = g_variant_print (message, TRUE); + g_message ("<<< %s", debugstr); + } } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonrpc-glib-3.28.0/src/jsonrpc-output-stream.c new/jsonrpc-glib-3.28.1/src/jsonrpc-output-stream.c --- old/jsonrpc-glib-3.28.0/src/jsonrpc-output-stream.c 2018-03-14 01:07:21.000000000 +0100 +++ new/jsonrpc-glib-3.28.1/src/jsonrpc-output-stream.c 2018-06-19 05:04:45.000000000 +0200 @@ -52,6 +52,7 @@ { GQueue queue; guint use_gvariant : 1; + guint processing : 1; } JsonrpcOutputStreamPrivate; G_DEFINE_TYPE_WITH_PRIVATE (JsonrpcOutputStream, jsonrpc_output_stream, G_TYPE_DATA_OUTPUT_STREAM) @@ -256,8 +257,10 @@ g_assert (JSONRPC_IS_OUTPUT_STREAM (self)); - if (priv->queue.length == 0 || - g_output_stream_has_pending (G_OUTPUT_STREAM (self))) + if (priv->queue.length == 0) + return; + + if (priv->processing) return; task = g_queue_pop_head (&priv->queue); @@ -265,6 +268,17 @@ data = g_bytes_get_data (bytes, &len); cancellable = g_task_get_cancellable (task); + if (g_output_stream_is_closed (G_OUTPUT_STREAM (self))) + { + g_task_return_new_error (task, + G_IO_ERROR, + G_IO_ERROR_CLOSED, + "Stream has been closed"); + return; + } + + priv->processing = TRUE; + g_output_stream_write_all_async (G_OUTPUT_STREAM (self), data, len, @@ -279,22 +293,23 @@ GAsyncResult *result, gpointer user_data) { - GOutputStream *stream = (GOutputStream *)object; - JsonrpcOutputStream *self; + JsonrpcOutputStream *self = (JsonrpcOutputStream *)object; + JsonrpcOutputStreamPrivate *priv = jsonrpc_output_stream_get_instance_private (self); g_autoptr(GError) error = NULL; g_autoptr(GTask) task = user_data; GBytes *bytes; gsize n_written; - g_assert (G_IS_OUTPUT_STREAM (stream)); + g_assert (JSONRPC_IS_OUTPUT_STREAM (self)); g_assert (G_IS_ASYNC_RESULT (result)); g_assert (G_IS_TASK (task)); - self = g_task_get_source_object (task); - g_assert (JSONRPC_IS_OUTPUT_STREAM (self)); - if (!g_output_stream_write_all_finish (stream, result, &n_written, &error)) + priv->processing = FALSE; + + if (!g_output_stream_write_all_finish (G_OUTPUT_STREAM (self), result, &n_written, &error)) { g_task_return_error (task, g_steal_pointer (&error)); + jsonrpc_output_stream_fail_pending (self); return; }
