changeset 2136:f1be45c9a742

mod_smacks: Prevent queuing multiple <r>
author Kim Alvefur <zash@zash.se>
date Mon, 21 Mar 2016 14:08:03 +0100
parents 42b095dab626
children 0fe725b50f77
files mod_smacks/mod_smacks.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_smacks/mod_smacks.lua	Mon Mar 21 13:18:04 2016 +0100
+++ b/mod_smacks/mod_smacks.lua	Mon Mar 21 14:08:03 2016 +0100
@@ -89,9 +89,9 @@
 		end
 		if #queue > max_unacked_stanzas and not session.awaiting_ack then
 			session.log("debug", "Queuing <r> (in a moment)");
+			session.awaiting_ack = true;
 			session.awaiting_ack_timer = module:add_timer(1e-06, function ()
 				if not session.awaiting_ack then
-					session.awaiting_ack = true;
 					session.log("debug", "Sending <r> (after send)");
 					(session.sends2s or session.send)(st.stanza("r", { xmlns = session.smacks }))
 				end