aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-08-08 16:41:09 +0200
committerKim Alvefur <zash@zash.se>2016-08-08 16:41:09 +0200
commit68f3c9dede8ad33e50057c2566964285e18874bc (patch)
tree28ff249f142d219a8fe1f7ede89996f393084875 /plugins
parent0b44bf4b7fbbc088ab2a1d90f7e19c68a46601ea (diff)
parent3506b088471128c7579c11782dff473223f49579 (diff)
downloadprosody-68f3c9dede8ad33e50057c2566964285e18874bc.tar.gz
prosody-68f3c9dede8ad33e50057c2566964285e18874bc.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_c2s.lua11
-rw-r--r--plugins/mod_s2s/mod_s2s.lua2
2 files changed, 8 insertions, 5 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua
index 703c4ac7..18375248 100644
--- a/plugins/mod_c2s.lua
+++ b/plugins/mod_c2s.lua
@@ -261,9 +261,9 @@ function listener.onconnect(conn)
function session.data(data)
-- Parse the data, which will store stanzas in session.pending_stanzas
if data then
- data = filter("bytes/in", data);
- if data then
- local ok, err = stream:feed(data);
+ data = filter("bytes/in", data);
+ if data then
+ local ok, err = stream:feed(data);
if not ok then
log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_"));
session:close("not-well-formed");
@@ -309,7 +309,10 @@ function listener.onreadtimeout(conn)
end
local function keepalive(event)
- return event.session.send(' ');
+ local session = event.session;
+ if not session.notopen then
+ return event.session.send(' ');
+ end
end
function listener.associate_session(conn, session)
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index fe674b55..a6fdd254 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -673,8 +673,8 @@ end
function listener.onreadtimeout(conn)
local session = sessions[conn];
- local host = session.host or session.to_host;
if session then
+ local host = session.host or session.to_host;
return (hosts[host] or prosody).events.fire_event("s2s-read-timeout", { session = session });
end
end