Comparison

plugins/mod_c2s.lua @ 8234:97b3ca502547

Merge 0.9->0.10
author Kim Alvefur <zash@zash.se>
date Thu, 14 Sep 2017 02:47:40 +0200
parent 8192:4354f556c5db
parent 8232:176b7f4e4ac9
child 8235:7d9a2c200736
child 8388:9ee56e9ad47a
comparison
equal deleted inserted replaced
8231:97a094fdf101 8234:97b3ca502547
109 elseif error == "parse-error" then 109 elseif error == "parse-error" then
110 (session.log or log)("debug", "Client XML parse error: %s", tostring(data)); 110 (session.log or log)("debug", "Client XML parse error: %s", tostring(data));
111 session:close("not-well-formed"); 111 session:close("not-well-formed");
112 elseif error == "stream-error" then 112 elseif error == "stream-error" then
113 local condition, text = "undefined-condition"; 113 local condition, text = "undefined-condition";
114 for child in data:children() do 114 for child in data:childtags(nil, xmlns_xmpp_streams) do
115 if child.attr.xmlns == xmlns_xmpp_streams then 115 if child.name ~= "text" then
116 if child.name ~= "text" then 116 condition = child.name;
117 condition = child.name; 117 else
118 else 118 text = child:get_text();
119 text = child:get_text(); 119 end
120 end 120 if condition ~= "undefined-condition" and text then
121 if condition ~= "undefined-condition" and text then 121 break;
122 break;
123 end
124 end 122 end
125 end 123 end
126 text = condition .. (text and (" ("..text..")") or ""); 124 text = condition .. (text and (" ("..text..")") or "");
127 session.log("info", "Session closed by remote with error: %s", text); 125 session.log("info", "Session closed by remote with error: %s", text);
128 session:close(nil, text); 126 session:close(nil, text);