mod_pinger: Don't ping when smacks hibernated the session, fixes #712

Thu, 06 Apr 2017 02:35:06 +0200

author
tmolitor <thilo@eightysoft.de>
date
Thu, 06 Apr 2017 02:35:06 +0200
changeset 2672
75ab061069aa
parent 2671
80b6c63cb559
child 2673
2e1a4740adee

mod_pinger: Don't ping when smacks hibernated the session, fixes #712

mod_pinger/mod_pinger.lua file | annotate | diff | comparison | revisions
--- a/mod_pinger/mod_pinger.lua	Thu Apr 06 02:31:16 2017 +0200
+++ b/mod_pinger/mod_pinger.lua	Thu Apr 06 02:35:06 2017 +0200
@@ -48,3 +48,7 @@
 
 module:hook("resource-bind", function (event) watch_session(event.session); end);
 module:hook("resource-unbind", function (event) unwatch_session(event.session); end);
+
+-- handle smacks sessions properly (not pinging in hibernated state)
+module:hook("smacks-hibernation-start", function (event) unwatch_session(event.origin); end);
+module:hook("smacks-hibernation-end", function (event) watch_session(event.origin); end);

mercurial