Software /
code /
prosody
Comparison
plugins/mod_component.lua @ 8234:97b3ca502547
Merge 0.9->0.10
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 14 Sep 2017 02:47:40 +0200 |
parent | 8134:b87e281a7d59 |
parent | 8233:4e7269c53659 |
child | 8235:7d9a2c200736 |
child | 8508:47115b0ca133 |
comparison
equal
deleted
inserted
replaced
8231:97a094fdf101 | 8234:97b3ca502547 |
---|---|
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); |