Changeset

1554:06030af44fad 0.5.0

util.xmlrpc: Fixed table serialization (regression introduced in previous change)
author Waqas Hussain <waqas20@gmail.com>
date Wed, 15 Jul 2009 01:40:11 +0500
parents 1552:334b66f614a6
children 1555:96d620b639d5 1563:c5078fab0978
files util/xmlrpc.lua
diffstat 1 files changed, 11 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/util/xmlrpc.lua	Tue Jul 14 21:04:22 2009 +0100
+++ b/util/xmlrpc.lua	Wed Jul 15 01:40:11 2009 +0500
@@ -46,17 +46,12 @@
 		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 @@
 	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