# HG changeset patch # User Kim Alvefur # Date 1360606891 -3600 # Node ID abf0f12fe75c49354b7d0add77090a9ccd4c8f96 # Parent c06369259aee5616f98cbd3cbb5254f686d08efa mod_smacks: Don't try to send stanzas to hibernating sessions. Fixes duplicate IQ replies on libevent. diff -r c06369259aee -r abf0f12fe75c mod_smacks/mod_smacks.lua --- a/mod_smacks/mod_smacks.lua Sun Feb 10 23:32:15 2013 +0000 +++ b/mod_smacks/mod_smacks.lua Mon Feb 11 19:21:31 2013 +0100 @@ -83,6 +83,11 @@ queue[#queue+1] = cached_stanza; end + if session.hibernating then + -- The session is hibernating, no point in sending the stanza + -- over a dead connection. It will be delivered upon resumption. + return true; + end local ok, err = _send(stanza); if ok and #queue > max_unacked_stanzas and not session.awaiting_ack and attr and not attr.xmlns then session.awaiting_ack = true;