mod_smacks: Check if session was really sleeping before logging message
authorKim Alvefur <zash@zash.se>
Sat, 18 Dec 2021 15:45:06 +0100
changeset 12078 b892f5489d79
parent 12077 4cbe7979a92a
child 12079 9f4d88f54a54
mod_smacks: Check if session was really sleeping before logging message It could have been resumed without going into hibernation first, i.e. when the client notices the disconnect before the server, or if it switches networks etc.
plugins/mod_smacks.lua
--- a/plugins/mod_smacks.lua	Sat Dec 18 13:58:33 2021 +0100
+++ b/plugins/mod_smacks.lua	Sat Dec 18 15:45:06 2021 +0100
@@ -504,7 +504,7 @@
 			original_session.log("debug", "Letting the watchdog go");
 			original_session.hibernating_watchdog:cancel();
 			original_session.hibernating_watchdog = nil;
-		else
+		elseif session.hibernating then
 			original_session.log("error", "Hibernating session has no watchdog!")
 		end
 		session.log("debug", "mod_smacks resuming existing session %s...", get_session_id(original_session));