Comparison

plugins/mod_c2s.lua @ 8235:7d9a2c200736

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Thu, 14 Sep 2017 02:48:34 +0200
parent 8201:a0ad62a269df
parent 8234:97b3ca502547
child 8390:4c629fde768c
comparison
equal deleted inserted replaced
8221:4989a625419a 8235:7d9a2c200736
110 elseif error == "parse-error" then 110 elseif error == "parse-error" then
111 (session.log or log)("debug", "Client XML parse error: %s", tostring(data)); 111 (session.log or log)("debug", "Client XML parse error: %s", tostring(data));
112 session:close("not-well-formed"); 112 session:close("not-well-formed");
113 elseif error == "stream-error" then 113 elseif error == "stream-error" then
114 local condition, text = "undefined-condition"; 114 local condition, text = "undefined-condition";
115 for child in data:children() do 115 for child in data:childtags(nil, xmlns_xmpp_streams) do
116 if child.attr.xmlns == xmlns_xmpp_streams then 116 if child.name ~= "text" then
117 if child.name ~= "text" then 117 condition = child.name;
118 condition = child.name; 118 else
119 else 119 text = child:get_text();
120 text = child:get_text(); 120 end
121 end 121 if condition ~= "undefined-condition" and text then
122 if condition ~= "undefined-condition" and text then 122 break;
123 break;
124 end
125 end 123 end
126 end 124 end
127 text = condition .. (text and (" ("..text..")") or ""); 125 text = condition .. (text and (" ("..text..")") or "");
128 session.log("info", "Session closed by remote with error: %s", text); 126 session.log("info", "Session closed by remote with error: %s", text);
129 session:close(nil, text); 127 session:close(nil, text);