Comparison

plugins/mod_component.lua @ 8235:7d9a2c200736

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Thu, 14 Sep 2017 02:48:34 +0200
parent 8146:5c91fb62338e
parent 8234:97b3ca502547
child 8518:0de0018bdf91
comparison
equal deleted inserted replaced
8221:4989a625419a 8235:7d9a2c200736
168 elseif error == "parse-error" then 168 elseif error == "parse-error" then
169 session.log("warn", "External component %s XML parse error: %s", tostring(session.host), tostring(data)); 169 session.log("warn", "External component %s XML parse error: %s", tostring(session.host), tostring(data));
170 session:close("not-well-formed"); 170 session:close("not-well-formed");
171 elseif error == "stream-error" then 171 elseif error == "stream-error" then
172 local condition, text = "undefined-condition"; 172 local condition, text = "undefined-condition";
173 for child in data:children() do 173 for child in data:childtags(nil, xmlns_xmpp_streams) do
174 if child.attr.xmlns == xmlns_xmpp_streams then 174 if child.name ~= "text" then
175 if child.name ~= "text" then 175 condition = child.name;
176 condition = child.name; 176 else
177 else 177 text = child:get_text();
178 text = child:get_text(); 178 end
179 end 179 if condition ~= "undefined-condition" and text then
180 if condition ~= "undefined-condition" and text then 180 break;
181 break;
182 end
183 end 181 end
184 end 182 end
185 text = condition .. (text and (" ("..text..")") or ""); 183 text = condition .. (text and (" ("..text..")") or "");
186 session.log("info", "Session closed by remote with error: %s", text); 184 session.log("info", "Session closed by remote with error: %s", text);
187 session:close(nil, text); 185 session:close(nil, text);