Software / code / prosody
Comparison
plugins/mod_smacks.lua @ 12072:ef0f174488af
mod_smacks: Fix duplicate sleep behavior when replacing a session
Fixes that an extra watchdog was set, leaking the previous one, which
went on to do behave as if the session times out.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 18 Dec 2021 13:48:57 +0100 |
| parent | 12070:e662c172ea0f |
| child | 12073:4cbe7979a92a |
comparison
equal
deleted
inserted
replaced
| 12071:85c8fcb4192e | 12072:ef0f174488af |
|---|---|
| 417 session.log("debug", "Destroying session with %d unacked stanzas", queue:count_unacked()); | 417 session.log("debug", "Destroying session with %d unacked stanzas", queue:count_unacked()); |
| 418 handle_unacked_stanzas(session); | 418 handle_unacked_stanzas(session); |
| 419 end | 419 end |
| 420 return | 420 return |
| 421 end | 421 end |
| 422 if session.hibernating then return end | |
| 422 | 423 |
| 423 session.hibernating = os_time(); | 424 session.hibernating = os_time(); |
| 424 session.hibernating_watchdog = watchdog.new(resume_timeout, function() | 425 session.hibernating_watchdog = watchdog.new(resume_timeout, function() |
| 425 session.log("debug", "mod_smacks hibernation timeout reached..."); | 426 session.log("debug", "mod_smacks hibernation timeout reached..."); |
| 426 if session.destroyed then | 427 if session.destroyed then |