Merge with 0.4 branch

Thu, 23 Apr 2009 21:06:08 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 23 Apr 2009 21:06:08 +0100
changeset 1054
084d265b37cf
parent 1050
9552c08241af (current diff)
parent 1053
c04b40a0740b (diff)
child 1058
63b7a81d45eb

Merge with 0.4 branch

net/httpserver.lua file | annotate | diff | comparison | revisions
--- a/core/xmlhandlers.lua	Thu Apr 23 03:28:35 2009 +0100
+++ b/core/xmlhandlers.lua	Thu Apr 23 21:06:08 2009 +0100
@@ -57,7 +57,11 @@
 				stanza:text(t_concat(chardata));
 				chardata = {};
 			end
-			local curr_ns,name = tagname:match("^(.+)|([^%|]+)$");
+			local curr_ns,name = tagname:match("^(.-)|?([^%|]-)$");
+			if not name then
+				curr_ns, name = "", curr_ns;
+			end
+
 			if curr_ns ~= stream_default_ns then
 				attr.xmlns = curr_ns;
 			end
@@ -109,7 +113,10 @@
 			end
 		end
 		function xml_handlers:EndElement(tagname)
-			curr_ns,name = tagname:match("^(.+)|([^%|]+)$");
+			curr_ns,name = tagname:match("^(.-)|?([^%|]-)$");
+			if not name then
+				curr_ns, name = "", curr_ns;
+			end
 			if (not stanza) or (#stanza.last_add > 0 and name ~= stanza.last_add[#stanza.last_add].name) then 
 				if tagname == stream_tag then
 					if cb_streamclosed then
--- a/net/httpserver.lua	Thu Apr 23 03:28:35 2009 +0100
+++ b/net/httpserver.lua	Thu Apr 23 21:06:08 2009 +0100
@@ -30,7 +30,7 @@
 	-- Write status line
 	local resp;
 	if response.body then
-		log("debug", "Sending response to %s: %s", request.id, response.body);
+		log("debug", "Sending response to %s", request.id);
 		resp = { "HTTP/1.0 ", response.status or "200 OK", "\r\n"};
 		local h = response.headers;
 		if h then
@@ -99,7 +99,7 @@
 			if response == true and not request.destroyed then
 				-- Keep connection open, we will reply later
 				log("warn", "Request %s left open, on_destroy is %s", request.id, tostring(request.on_destroy));
-			else
+			elseif response ~= true then
 				-- Assume response
 				send_response(request, response);
 				destroy_request(request);

mercurial