Changeset

202:d11478ae374e

mod_smacks: Clean outgoing stanza queue correctly on session close
author Matthew Wild <mwild1@gmail.com>
date Thu, 08 Jul 2010 14:01:52 +0100
parents 201:bc24f58a0d39
children 203:4927b9737bb7
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	Thu Jul 08 14:01:32 2010 +0100
+++ b/mod_smacks/mod_smacks.lua	Thu Jul 08 14:01:52 2010 +0100
@@ -90,6 +90,7 @@
 	local queue = session.outgoing_stanza_queue;
 	local error_attr = { type = "cancel" };
 	if #queue > 0 then
+		session.outgoing_stanza_queue = {};
 		for i=1,#queue do
 			local reply = queue[i];
 			if reply.attr.to ~= session.full_jid then
@@ -98,7 +99,6 @@
 					:tag("recipient-unavailable", {xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas"});
 				core_process_stanza(session, queue[i]);
 			end
-			queue[i] = nil;
 		end
 	end
 end