# HG changeset patch # User Kim Alvefur # Date 1413203476 -7200 # Node ID 604a8cee9d5870a7f8c0747b811b8e77951942fb # Parent d4a4ed31567ecd259b1ba95eb7eebeeb668fcf0d# Parent 54f6158a491547b26a1dd92c463b651c8856417e Merge diff -r 54f6158a4915 -r 604a8cee9d58 mod_smacks/mod_smacks.lua --- a/mod_smacks/mod_smacks.lua Sun Oct 12 17:09:07 2014 +0200 +++ b/mod_smacks/mod_smacks.lua Mon Oct 13 14:31:16 2014 +0200 @@ -72,7 +72,6 @@ local is_stanza = stanza.attr and not stanza.attr.xmlns; if is_stanza and not stanza._cached then -- Stanza in default stream namespace local queue = session.outgoing_stanza_queue; - module:log("debug", "st.clone( %s ) -- %s a stanza", tostring(stanza), is_stanza and "is" or "is not"); local cached_stanza = st.clone(stanza); cached_stanza._cached = true; @@ -82,6 +81,10 @@ queue[#queue+1] = cached_stanza; session.log("debug", "#queue = %d", #queue); + if session.hibernating then + session.log("debug", "hibernating, stanza queued"); + return ""; -- Hack to make session.send() not return nil + end if #queue > max_unacked_stanzas then module:add_timer(0, function () if not session.awaiting_ack then @@ -91,12 +94,6 @@ end); end end - if session.hibernating then - session.log("debug", "hibernating, stanza queued") - -- The session is hibernating, no point in sending the stanza - -- over a dead connection. It will be delivered upon resumption. - return nil; -- or empty string? - end return stanza; end @@ -109,7 +106,6 @@ end local function wrap_session(session, resume) - -- Overwrite process_stanza() and send() local queue; if not resume then queue = {};