Changeset

161:8c1a8a3e32e8

Destroy s2s sendqueue when connection is established successfully and data written
author Matthew Wild <mwild1@gmail.com>
date Fri, 24 Oct 2008 15:32:31 +0100
parents 160:018c7f5ef0ea
children 162:b1099bdd2724
files core/s2smanager.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/core/s2smanager.lua	Fri Oct 24 15:20:34 2008 +0100
+++ b/core/s2smanager.lua	Fri Oct 24 15:32:31 2008 +0100
@@ -171,10 +171,12 @@
 	local sendq, send = session.sendq, session.send;
 	if sendq then
 		session.log("debug", "sending queued stanzas across new connection");
-		for _, data in ipairs(sendq) do
+		for i, data in ipairs(sendq) do
 			session.log("debug", "sending: %s", tostring(data));
 			send(data);
+			sendq[i] = nil;
 		end
+		session.sendq = nil;
 	end
 end