aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-01-26 03:39:24 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-01-26 03:39:24 +0500
commitb713b42e1b055f706677dd8c18e0fea6a25431fa (patch)
treed557a65385faff572b3ecf80d00e529e50d5be75 /core
parenta44cc062d203e1e7d00e8b8c10ff15a0ac977024 (diff)
downloadprosody-b713b42e1b055f706677dd8c18e0fea6a25431fa.tar.gz
prosody-b713b42e1b055f706677dd8c18e0fea6a25431fa.zip
xmlhandlers: A little optimization.
Diffstat (limited to 'core')
-rw-r--r--core/xmlhandlers.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/xmlhandlers.lua b/core/xmlhandlers.lua
index 3d6ace12..5d565845 100644
--- a/core/xmlhandlers.lua
+++ b/core/xmlhandlers.lua
@@ -112,10 +112,6 @@ function init_xmlhandlers(session, stream_callbacks)
end
end
function xml_handlers:EndElement(tagname)
- local curr_ns,name = tagname:match(ns_pattern);
- if name == "" then
- curr_ns, name = "", curr_ns;
- end
if stanza then
if #chardata > 0 then
-- We have some character data in the buffer
@@ -139,6 +135,10 @@ function init_xmlhandlers(session, stream_callbacks)
cb_streamclosed(session);
end
else
+ local curr_ns,name = tagname:match(ns_pattern);
+ if name == "" then
+ curr_ns, name = "", curr_ns;
+ end
cb_error(session, "parse-error", "unexpected-element-close", name);
end
stanza, chardata = nil, {};