diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-04-23 21:06:51 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-04-23 21:06:51 +0100 |
commit | 2e3907bc3e56c60f947ebda858c632e9a5110943 (patch) | |
tree | b441067f58db864cb5cc070e8ba08d6f45b2e45c | |
parent | 3ab59e41d362ca0f1e30f18763ad9522359f6b0b (diff) | |
parent | c2e552a434eda3c9616d51f055bb459bbf561816 (diff) | |
download | prosody-2e3907bc3e56c60f947ebda858c632e9a5110943.tar.gz prosody-2e3907bc3e56c60f947ebda858c632e9a5110943.zip |
Automated merge with http://waqas.ath.cx:8000/
-rw-r--r-- | core/xmlhandlers.lua | 11 | ||||
-rw-r--r-- | net/httpserver.lua | 4 |
2 files changed, 11 insertions, 4 deletions
diff --git a/core/xmlhandlers.lua b/core/xmlhandlers.lua index 67a0829d..7e09921c 100644 --- a/core/xmlhandlers.lua +++ b/core/xmlhandlers.lua @@ -57,7 +57,11 @@ function init_xmlhandlers(session, stream_callbacks) 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 @@ function init_xmlhandlers(session, stream_callbacks) 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 diff --git a/net/httpserver.lua b/net/httpserver.lua index 79cf33c2..0ecf84ea 100644 --- a/net/httpserver.lua +++ b/net/httpserver.lua @@ -30,7 +30,7 @@ local function send_response(request, response) -- 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 @@ local function call_callback(request, err) 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); |