aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-03-24 18:30:51 +0100
committerKim Alvefur <zash@zash.se>2019-03-24 18:30:51 +0100
commit9e7035be7282a7902989904cec6aeec879814f49 (patch)
tree276b3ac38803ee60a6d08f1431c111d95f1b0ab1
parent8e68b0dd1adfcd7932f368a0b00dd2019c95db38 (diff)
downloadprosody-9e7035be7282a7902989904cec6aeec879814f49.tar.gz
prosody-9e7035be7282a7902989904cec6aeec879814f49.zip
mod_c2s: Fire an event when outgoing buffers have been emptied
-rw-r--r--plugins/mod_c2s.lua7
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