# HG changeset patch # User Kim Alvefur # Date 1443556480 -7200 # Node ID 3683eb95bc1afed25e71f1b161a00f6756dbdff4 # Parent a7c1f1b6ef05ef06370764c492757f48861859d3 mod_smacks: Add experimental resending of unacked messages in s2s queues (disabled by default) diff -r a7c1f1b6ef05 -r 3683eb95bc1a mod_smacks/mod_smacks.lua --- a/mod_smacks/mod_smacks.lua Tue Sep 29 14:56:46 2015 +0200 +++ b/mod_smacks/mod_smacks.lua Tue Sep 29 21:54:40 2015 +0200 @@ -31,6 +31,7 @@ local resume_timeout = module:get_option_number("smacks_hibernation_time", 300); local s2s_smacks = module:get_option_boolean("smacks_enabled_s2s", false); +local s2s_resend = module:get_option_boolean("smacks_s2s_resend", false); local max_unacked_stanzas = module:get_option_number("smacks_max_unacked_stanzas", 0); local core_process_stanza = prosody.core_process_stanza; local sessionmanager = require"core.sessionmanager"; @@ -303,7 +304,14 @@ local queue = session.outgoing_stanza_queue; if queue and #queue > 0 then session.log("warn", "Destroying session with %d unacked stanzas", #queue); - handle_unacked_stanzas(session); + if s2s_resend then + for i = 1, #queue do + module:send(queue[i]); + end + session.outgoing_stanza_queue = nil; + else + handle_unacked_stanzas(session); + end end end