mirror of
https://github.com/anope/anope.git
synced 2026-07-04 22:13:12 +02:00
Allow use of a non-map type as the root RPC element.
This commit is contained in:
@@ -116,7 +116,6 @@ public:
|
||||
Anope::string param;
|
||||
if (xmlrpc_value_type(value) != XMLRPC_TYPE_STRING)
|
||||
{
|
||||
// TODO: error;
|
||||
xmlrpc_env_set_fault(&env, RPC::ERR_INVALID_REQUEST, "Anope XML-RPC only supports strings");
|
||||
SendError(reply, env);
|
||||
xmlrpc_DECREF(value);
|
||||
@@ -160,8 +159,11 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
auto *value = xmlrpc_struct_new(&env);
|
||||
SerializeMap(env, value, request);
|
||||
xmlrpc_value *value;
|
||||
if (request.GetRoot())
|
||||
value = SerializeElement(env, request.GetRoot().value());
|
||||
else
|
||||
value = xmlrpc_nil_new(&env);
|
||||
|
||||
auto *response = xmlrpc_mem_block_new(&env, 0);
|
||||
xmlrpc_serialize_response(&env, response, value);
|
||||
|
||||
Reference in New Issue
Block a user