mod_smacks: Don't try to send stanzas to hibernating sessions. Fixes duplicate IQ replies on libevent.
--- 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;