Comparison

plugins/mod_smacks.lua @ 12070:e662c172ea0f

mod_smacks: Remove references to connection on hibernation Still having the connection on the session may cause unintentional behavior, such as the session being treated as if connected, even tho the connection has been closed.
author Kim Alvefur <zash@zash.se>
date Sat, 18 Dec 2021 12:50:53 +0100
parent 12069:b9e08cbd032b
child 12072:ef0f174488af
comparison
equal deleted inserted replaced
12069:b9e08cbd032b 12070:e662c172ea0f
438 session.resumption_token = nil; 438 session.resumption_token = nil;
439 session.resending_unacked = true; -- stop outgoing_stanza_filter from re-queueing anything anymore 439 session.resending_unacked = true; -- stop outgoing_stanza_filter from re-queueing anything anymore
440 sessionmanager.destroy_session(session, "Hibernating too long"); 440 sessionmanager.destroy_session(session, "Hibernating too long");
441 end); 441 end);
442 if session.conn then 442 if session.conn then
443 session.conn:close(); 443 local conn = session.conn;
444 c2s_sessions[conn] = nil;
445 session.conn = nil;
446 conn:close();
444 end 447 end
445 module:fire_event("smacks-hibernation-start", { origin = session; queue = session.outgoing_stanza_queue:table() }); 448 module:fire_event("smacks-hibernation-start", { origin = session; queue = session.outgoing_stanza_queue:table() });
446 return true; -- Postpone destruction for now 449 return true; -- Postpone destruction for now
447 end); 450 end);
448 451