Merge with 0.5

Tue, 14 Jul 2009 22:12:13 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 14 Jul 2009 22:12:13 +0100
changeset 1555
96d620b639d5
parent 1553
5e7b1d4ee655 (current diff)
parent 1554
06030af44fad (diff)
child 1556
8154aa1fbe6c

Merge with 0.5

--- a/util/xmlrpc.lua	Tue Jul 14 21:04:57 2009 +0100
+++ b/util/xmlrpc.lua	Tue Jul 14 22:12:13 2009 +0100
@@ -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

mercurial