mod_smacks: Wrap session:close() and make the session not resumable
authorKim Alvefur <zash@zash.se>
Thu, 25 Apr 2013 17:37:33 +0200
changeset 988 c15cea87036f
parent 987 fabff75bfc3f
child 989 7c04c5856daa
mod_smacks: Wrap session:close() and make the session not resumable
mod_smacks/mod_smacks.lua
--- a/mod_smacks/mod_smacks.lua	Thu Apr 25 17:34:30 2013 +0200
+++ b/mod_smacks/mod_smacks.lua	Thu Apr 25 17:37:33 2013 +0200
@@ -101,6 +101,15 @@
 	else
 		session.send = new_send;
 	end
+
+	local session_close = session.close;
+	function session.close(...)
+		if session.resumption_token then
+			session_registry[session.resumption_token] = nil;
+			session.resumption_token = nil;
+		end
+		return session_close(...);
+	end
 	
 	if not resume then
 		session.handled_stanza_count = 0;