diff options
author | Kim Alvefur <zash@zash.se> | 2016-08-08 16:41:09 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-08-08 16:41:09 +0200 |
commit | 69f217b1ca6186253459f8c3d0772b814e7aa0dc (patch) | |
tree | 28ff249f142d219a8fe1f7ede89996f393084875 /plugins/mod_c2s.lua | |
parent | ac565db2d8dc8239ab1c6bf4d3fadc2ca8c78d5f (diff) | |
parent | 8499f4e7214e86623d614368268913418289254c (diff) | |
download | prosody-69f217b1ca6186253459f8c3d0772b814e7aa0dc.tar.gz prosody-69f217b1ca6186253459f8c3d0772b814e7aa0dc.zip |
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_c2s.lua')
-rw-r--r-- | plugins/mod_c2s.lua | 11 |
1 files changed, 7 insertions, 4 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) |