Comparison

plugins/mod_s2s.lua @ 11740:b92f2abe0bda

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
author Kim Alvefur <zash@zash.se>
date Mon, 16 Aug 2021 11:37:51 +0200
parent 11707:61759372be26
child 11742:9c450185bac1
comparison
equal deleted inserted replaced
11739:e0d0680e04cc 11740:b92f2abe0bda
851 local host = session.host or session.to_host; 851 local host = session.host or session.to_host;
852 return (hosts[host] or prosody).events.fire_event("s2s-read-timeout", { session = session }); 852 return (hosts[host] or prosody).events.fire_event("s2s-read-timeout", { session = session });
853 end 853 end
854 end 854 end
855 855
856 function listener.ondrain(conn)
857 local session = sessions[conn];
858 if session then
859 return (hosts[session.host] or prosody).events.fire_event("s2s-ondrain", { session = session });
860 end
861 end
862
856 function listener.register_outgoing(conn, session) 863 function listener.register_outgoing(conn, session)
857 sessions[conn] = session; 864 sessions[conn] = session;
858 initialize_session(session); 865 initialize_session(session);
859 end 866 end
860 867