aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-08-16 11:37:51 +0200
committerKim Alvefur <zash@zash.se>2021-08-16 11:37:51 +0200
commitb686dda4afa8f519830997dc88386a37e371d47e (patch)
tree484bb22bf38fac858d7f0abd709c7efb19ff54d7 /plugins
parentf679f0b26eb20b702dd274b136e21218c73bc3de (diff)
downloadprosody-b686dda4afa8f519830997dc88386a37e371d47e.tar.gz
prosody-b686dda4afa8f519830997dc88386a37e371d47e.zip
mod_s2s: Fire 's2s-ondrain' event, mirroring mod_c2s
Signals that any pending outgoing stanzas that were in the write buffer have at least been sent off to the Kernel and maybe even sent out over the network. See 7a703af90c9c for mod_c2s commit
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_s2s.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/mod_s2s.lua b/plugins/mod_s2s.lua
index 1e0fb955..75eb15ca 100644
--- a/plugins/mod_s2s.lua
+++ b/plugins/mod_s2s.lua
@@ -853,6 +853,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("s2s-ondrain", { session = session });
+ end
+end
+
function listener.register_outgoing(conn, session)
sessions[conn] = session;
initialize_session(session);