Software /
code /
prosody
Diff
plugins/mod_c2s.lua @ 11742:9c450185bac1
mod_c2s,mod_s2s: Fire event just before writes
Could allow e.g. a XEP-0198 implementation to efficiently send ack
requests at optimal times without using timers or nextTick.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 16 Aug 2021 12:45:14 +0200 |
parent | 11622:a62146353528 |
child | 11747:9f723b54e111 |
line wrap: on
line diff
--- a/plugins/mod_c2s.lua Mon Aug 16 12:34:52 2021 +0200 +++ b/plugins/mod_c2s.lua Mon Aug 16 12:45:14 2021 +0200 @@ -393,6 +393,13 @@ end end +function listener.onpredrain(conn) + local session = sessions[conn]; + if session then + return (hosts[session.host] or prosody).events.fire_event("c2s-pre-ondrain", { session = session }); + end +end + local function keepalive(event) local session = event.session; if not session.notopen then