Comparison

net/xmppserver_listener.lua @ 3634:0d6b57edb7bd

net.xmpp{client,server,component}_listener: s/xml-not-well-formed/not-well-formed/ as per latest bis drafts.
author Waqas Hussain <waqas20@gmail.com>
date Sat, 20 Nov 2010 02:33:36 +0500
parent 3345:8520cd88b84c
child 3753:f66206484528
comparison
equal deleted inserted replaced
3633:4069c37c54bc 3634:0d6b57edb7bd
25 function stream_callbacks.error(session, error, data) 25 function stream_callbacks.error(session, error, data)
26 if error == "no-stream" then 26 if error == "no-stream" then
27 session:close("invalid-namespace"); 27 session:close("invalid-namespace");
28 elseif error == "parse-error" then 28 elseif error == "parse-error" then
29 session.log("debug", "Server-to-server XML parse error: %s", tostring(error)); 29 session.log("debug", "Server-to-server XML parse error: %s", tostring(error));
30 session:close("xml-not-well-formed"); 30 session:close("not-well-formed");
31 elseif error == "stream-error" then 31 elseif error == "stream-error" then
32 local condition, text = "undefined-condition"; 32 local condition, text = "undefined-condition";
33 for child in data:children() do 33 for child in data:children() do
34 if child.attr.xmlns == xmlns_xmpp_streams then 34 if child.attr.xmlns == xmlns_xmpp_streams then
35 if child.name ~= "text" then 35 if child.name ~= "text" then
134 if data then 134 if data then
135 local ok, err = stream:feed(data); 135 local ok, err = stream:feed(data);
136 if ok then return; end 136 if ok then return; end
137 (session.log or log)("warn", "Received invalid XML: %s", data); 137 (session.log or log)("warn", "Received invalid XML: %s", data);
138 (session.log or log)("warn", "Problem was: %s", err); 138 (session.log or log)("warn", "Problem was: %s", err);
139 session:close("xml-not-well-formed"); 139 session:close("not-well-formed");
140 end 140 end
141 end 141 end
142 142
143 session.close = session_close; 143 session.close = session_close;
144 local handlestanza = stream_callbacks.handlestanza; 144 local handlestanza = stream_callbacks.handlestanza;