Comparison

core/s2smanager.lua @ 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
parent 157:f4e9b6ec34b0
child 162:b1099bdd2724
comparison
equal deleted inserted replaced
160:018c7f5ef0ea 161:8c1a8a3e32e8
169 169
170 function mark_connected(session) 170 function mark_connected(session)
171 local sendq, send = session.sendq, session.send; 171 local sendq, send = session.sendq, session.send;
172 if sendq then 172 if sendq then
173 session.log("debug", "sending queued stanzas across new connection"); 173 session.log("debug", "sending queued stanzas across new connection");
174 for _, data in ipairs(sendq) do 174 for i, data in ipairs(sendq) do
175 session.log("debug", "sending: %s", tostring(data)); 175 session.log("debug", "sending: %s", tostring(data));
176 send(data); 176 send(data);
177 sendq[i] = nil;
177 end 178 end
179 session.sendq = nil;
178 end 180 end
179 end 181 end
180 182
181 return _M; 183 return _M;