[libsoup/wip/xmlrpc-variant] xmlrpc: remove support for 'g' and 'o' (de)serialization
- From: Xavier Claessens <xclaesse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/wip/xmlrpc-variant] xmlrpc: remove support for 'g' and 'o' (de)serialization
- Date: Mon, 10 Aug 2015 19:47:35 +0000 (UTC)
commit 9dec30001021e64c71082588b35f08c9a75cc433
Author: Xavier Claessens <xavier claessens collabora com>
Date: Mon Aug 10 15:25:12 2015 -0400
xmlrpc: remove support for 'g' and 'o' (de)serialization
libsoup/soup-xmlrpc.c | 19 ++++++-------------
tests/xmlrpc-test.c | 9 ---------
2 files changed, 6 insertions(+), 22 deletions(-)
---
diff --git a/libsoup/soup-xmlrpc.c b/libsoup/soup-xmlrpc.c
index 1bb29ea..73948ed 100644
--- a/libsoup/soup-xmlrpc.c
+++ b/libsoup/soup-xmlrpc.c
@@ -146,8 +146,6 @@ insert_value (xmlNode *parent, GVariant *value, GError **error)
type_str = "double";
break;
case G_VARIANT_CLASS_STRING:
- case G_VARIANT_CLASS_OBJECT_PATH:
- case G_VARIANT_CLASS_SIGNATURE:
xmlNewTextChild (xvalue, NULL,
(const xmlChar *)"string",
(const xmlChar *)g_variant_get_string (value, NULL));
@@ -218,6 +216,8 @@ insert_value (xmlNode *parent, GVariant *value, GError **error)
case G_VARIANT_CLASS_HANDLE:
case G_VARIANT_CLASS_MAYBE:
case G_VARIANT_CLASS_UINT64:
+ case G_VARIANT_CLASS_OBJECT_PATH:
+ case G_VARIANT_CLASS_SIGNATURE:
default:
g_set_error (error, SOUP_XMLRPC_ERROR, SOUP_XMLRPC_ERROR_ARGUMENTS,
"Unsupported type: %s", g_variant_get_type_string (value));
@@ -256,13 +256,13 @@ fail:
* - byte, int16, uint16 and int32 are serialized as <int>
* - uint32 and int64 are serialized as the nonstandard <i8> type
* - doubles are serialized as <double>
- * - Strings (including object-paths and signatures) are serialized as <string>
+ * - Strings are serialized as <string>
* - Variants (i.e. "v" type) are unwrapped and their child is serialized.
* - #GVariants created by soup_xmlrpc_variant_new_datetime() are serialized as
* <dateTime.iso8601>
* - Other types are not supported and will return %NULL and set @error.
- * This notably includes: uint64, maybes and dictionaries with non-string
- * keys.
+ * This notably includes: object-paths, signatures, uint64, handles, maybes
+ * and dictionaries with non-string keys.
*
* If @params is floating, it is consumed.
*
@@ -1010,12 +1010,6 @@ parse_value (xmlNode *node, const char **signature, GError **error)
content = xmlNodeGetContent (typenode);
if (class == G_VARIANT_CLASS_VARIANT || class == G_VARIANT_CLASS_STRING)
variant = g_variant_new_string ((const char *)content);
- else if (class == G_VARIANT_CLASS_OBJECT_PATH &&
- g_variant_is_object_path ((const char *)content))
- variant = g_variant_new_object_path ((const char *)content);
- else if (class == G_VARIANT_CLASS_SIGNATURE &&
- g_variant_is_signature ((const char *)content))
- variant = g_variant_new_signature ((const char *)content);
else {
g_set_error (error, SOUP_XMLRPC_ERROR, SOUP_XMLRPC_ERROR_ARGUMENTS,
"<string> node does not match signature");
@@ -1268,8 +1262,7 @@ fail:
* - <array> will be deserialized to "av". @signature could define
* another element type (e.g. "as") or could be a tuple (e.g. "(ss)").
* - <base64> will be deserialized to "ay".
- * - <string> will be deserialized to "s". @signature could define
- * another type ("o" or "g").
+ * - <string> will be deserialized to "s".
* - <dateTime.iso8601> will be deserialized to int64 unix timestamp.
* - @signature must not have maybes, otherwise an error is returned.
* - Dictionaries must have string keys, otherwise an error is returned.
diff --git a/tests/xmlrpc-test.c b/tests/xmlrpc-test.c
index f9bbb2c..fd73c42 100644
--- a/tests/xmlrpc-test.c
+++ b/tests/xmlrpc-test.c
@@ -617,11 +617,6 @@ test_deserializer (void)
"<params>"
"<param><value><base64>Ynl0ZXN0cmluZwA=</base64></value></param>"
"</params>");
- verify_deserialization (g_variant_new_parsed ("(@o '/path',)"),
- "(o)",
- "<params>"
- "<param><value><string>/path</string></value></param>"
- "</params>");
verify_deserialization (g_variant_new_parsed ("[<1>]"),
"av",
"<params><param><value><int>1</int></value></param></params>");
@@ -643,10 +638,6 @@ test_deserializer (void)
"(t)", tmp);
g_free (tmp);
- verify_deserialization_fail ("(o)",
- "<params>"
- "<param><value><string>not/a/path</string></value></param>"
- "</params>");
verify_deserialization_fail (NULL,
"<params>"
"<param><value><boolean>2</boolean></value></param>"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]