Software /
code /
prosody
Comparison
plugins/mod_smacks.lua @ 12074:b892f5489d79
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.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 18 Dec 2021 15:45:06 +0100 |
parent | 12073:4cbe7979a92a |
child | 12075:9f4d88f54a54 |
comparison
equal
deleted
inserted
replaced
12073:4cbe7979a92a | 12074:b892f5489d79 |
---|---|
502 else | 502 else |
503 if original_session.hibernating_watchdog then | 503 if original_session.hibernating_watchdog then |
504 original_session.log("debug", "Letting the watchdog go"); | 504 original_session.log("debug", "Letting the watchdog go"); |
505 original_session.hibernating_watchdog:cancel(); | 505 original_session.hibernating_watchdog:cancel(); |
506 original_session.hibernating_watchdog = nil; | 506 original_session.hibernating_watchdog = nil; |
507 else | 507 elseif session.hibernating then |
508 original_session.log("error", "Hibernating session has no watchdog!") | 508 original_session.log("error", "Hibernating session has no watchdog!") |
509 end | 509 end |
510 session.log("debug", "mod_smacks resuming existing session %s...", get_session_id(original_session)); | 510 session.log("debug", "mod_smacks resuming existing session %s...", get_session_id(original_session)); |
511 original_session.log("debug", "mod_smacks session resumed from %s...", get_session_id(session)); | 511 original_session.log("debug", "mod_smacks session resumed from %s...", get_session_id(session)); |
512 -- TODO: All this should move to sessionmanager (e.g. session:replace(new_session)) | 512 -- TODO: All this should move to sessionmanager (e.g. session:replace(new_session)) |