diff options
author | Kim Alvefur <zash@zash.se> | 2019-03-24 18:30:51 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-03-24 18:30:51 +0100 |
commit | ee4a464a26db437f1b187c4a6cd83a53492010fc (patch) | |
tree | 276b3ac38803ee60a6d08f1431c111d95f1b0ab1 | |
parent | 7ef5adb448ad36074123a924dc80607e087ed200 (diff) | |
download | prosody-ee4a464a26db437f1b187c4a6cd83a53492010fc.tar.gz prosody-ee4a464a26db437f1b187c4a6cd83a53492010fc.zip |
mod_c2s: Fire an event when outgoing buffers have been emptied
-rw-r--r-- | plugins/mod_c2s.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index 8d7b92fe..7c6d95f7 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -332,6 +332,13 @@ function listener.onreadtimeout(conn) end end +function listener.ondrain(conn) + local session = sessions[conn]; + if session then + return (hosts[session.host] or prosody).events.fire_event("c2s-ondrain", { session = session }); + end +end + local function keepalive(event) local session = event.session; if not session.notopen then |