Comparison

mod_smacks/mod_smacks.lua @ 625:2c07bcf56a36 0.8-diverge

mod_smacks: Don't hibernate session on graceful stream close
author Matthew Wild <mwild1@gmail.com>
date Mon, 19 Mar 2012 17:06:02 +0000
parent 624:55a9d3c2f73b
child 640:d87131b29bbd
comparison
equal deleted inserted replaced
624:55a9d3c2f73b 625:2c07bcf56a36
199 end 199 end
200 end 200 end
201 201
202 module:hook("pre-resource-unbind", function (event) 202 module:hook("pre-resource-unbind", function (event)
203 local session, err = event.session, event.error; 203 local session, err = event.session, event.error;
204 if session.smacks then 204 if session.smacks and err ~= "session closed" then
205 if not session.resumption_token then 205 if not session.resumption_token then
206 local queue = session.outgoing_stanza_queue; 206 local queue = session.outgoing_stanza_queue;
207 if #queue > 0 then 207 if #queue > 0 then
208 module:log("warn", "Destroying session with %d unacked stanzas:", #queue); 208 module:log("warn", "Destroying session with %d unacked stanzas:", #queue);
209 for i=1,#queue do 209 for i=1,#queue do