[jsonrpc-glib] input-stream: special case unwrapping of variant message
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jsonrpc-glib] input-stream: special case unwrapping of variant message
- Date: Tue, 31 Jul 2018 00:52:22 +0000 (UTC)
commit 018cae04ec3b6691ba7d4d97e63a54f452303468
Author: Christian Hergert <chergert redhat com>
Date: Mon Jul 30 17:52:04 2018 -0700
input-stream: special case unwrapping of variant message
We don't ever really want the variant of variant returned as the message,
so just unwrap it for the caller automatically.
src/jsonrpc-input-stream.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/jsonrpc-input-stream.c b/src/jsonrpc-input-stream.c
index 00361c7..d16cdba 100644
--- a/src/jsonrpc-input-stream.c
+++ b/src/jsonrpc-input-stream.c
@@ -321,7 +321,13 @@ jsonrpc_input_stream_read_message_finish (JsonrpcInputStream *self,
ret = local_message != NULL;
if (message != NULL)
- *message = g_steal_pointer (&local_message);
+ {
+ /* Unbox the variant if it is in a wrapper */
+ if (local_message && g_variant_is_of_type (local_message, G_VARIANT_TYPE_VARIANT))
+ *message = g_variant_get_variant (local_message);
+ else
+ *message = g_steal_pointer (&local_message);
+ }
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]