aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-07-15 01:40:11 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-07-15 01:40:11 +0500
commitc4acb049235afac930d84d1a68325b9d37f64d3c (patch)
treee82c9c33ab497ac039597407e34543c87f79350d /util
parent40f2dda03d4459ebd4e0928e3a671a4024c23b7a (diff)
downloadprosody-c4acb049235afac930d84d1a68325b9d37f64d3c.tar.gz
prosody-c4acb049235afac930d84d1a68325b9d37f64d3c.zip
util.xmlrpc: Fixed table serialization (regression introduced in previous change)vault/0.5.00.5.0
Diffstat (limited to 'util')
-rw-r--r--util/xmlrpc.lua23
1 files changed, 11 insertions, 12 deletions
diff --git a/util/xmlrpc.lua b/util/xmlrpc.lua
index 478c2a1c..4855b323 100644
--- a/util/xmlrpc.lua
+++ b/util/xmlrpc.lua
@@ -46,17 +46,12 @@ local map = {
stanza:tag("nil"):up();
end;
};
-_lua_to_xmlrpc = function(stanza, ...)
- for i=1,select('#', ...) do
- stanza:tag("param"):tag("value");
- local object = select(i, ...);
- local h = map[type(object)];
- if h then
- h(stanza, object);
- else
- error("Type not supported by XML-RPC: " .. type(object));
- end
- stanza:up():up();
+_lua_to_xmlrpc = function(stanza, object)
+ local h = map[type(object)];
+ if h then
+ h(stanza, object);
+ else
+ error("Type not supported by XML-RPC: " .. type(object));
end
end
function create_response(object)
@@ -76,7 +71,11 @@ function create_request(method_name, ...)
local stanza = st.stanza("methodCall")
:tag("methodName"):text(method_name):up()
:tag("params");
- _lua_to_xmlrpc(stanza, ...);
+ for i=1,select('#', ...) do
+ stanza:tag("param"):tag("value");
+ _lua_to_xmlrpc(stanza, select(i, ...));
+ stanza:up():up();
+ end
stanza:up():up():up();
return stanza;
end