diff options
author | Kim Alvefur <zash@zash.se> | 2019-07-08 02:44:32 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-07-08 02:44:32 +0200 |
commit | f2b49140d8f9309bb3613effbef0739216ba7a9b (patch) | |
tree | 6b13265c066c8c32f4ed5d44fc9ca8421d118d06 /plugins/mod_component.lua | |
parent | e081fd664251a2eb7ab68262c2b8a3cad4b381c7 (diff) | |
parent | ae48864f9d7368bf2030d391d68d6363278202ea (diff) | |
download | prosody-f2b49140d8f9309bb3613effbef0739216ba7a9b.tar.gz prosody-f2b49140d8f9309bb3613effbef0739216ba7a9b.zip |
Merge 0.11->trunk
Diffstat (limited to 'plugins/mod_component.lua')
-rw-r--r-- | plugins/mod_component.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua index b41204a2..b1ffc81d 100644 --- a/plugins/mod_component.lua +++ b/plugins/mod_component.lua @@ -49,6 +49,7 @@ function module.add_host(module) local send; local function on_destroy(session, err) --luacheck: ignore 212/err + module:set_status("warn", err and ("Disconnected: "..err) or "Disconnected"); env.connected = false; env.session = false; send = nil; @@ -102,6 +103,7 @@ function module.add_host(module) module:log("info", "External component successfully authenticated"); session.send(st.stanza("handshake")); module:fire_event("component-authenticated", { session = session }); + module:set_status("info", "Connected"); return true; end @@ -310,7 +312,7 @@ function listener.onconnect(conn) function session.data(_, data) local ok, err = stream:feed(data); if ok then return; end - module:log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_")); + log("debug", "Received invalid XML (%s) %d bytes: %q", tostring(err), #data, data:sub(1, 300)); session:close("not-well-formed"); end |