Software /
code /
prosody
Diff
plugins/mod_smacks.lua @ 12077:061d516d8ac5
mod_smacks: Fix error on shutdown if loaded on Component
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 20 Dec 2021 00:04:32 +0100 |
parent | 12076:ad1fe36eaae7 |
child | 12078:2c13aaae35ac |
line wrap: on
line diff
--- a/plugins/mod_smacks.lua Sun Dec 19 15:00:22 2021 +0100 +++ b/plugins/mod_smacks.lua Mon Dec 20 00:04:32 2021 +0100 @@ -630,6 +630,10 @@ module:hook("c2s-read-timeout", handle_read_timeout); module:hook_global("server-stopping", function(event) + if not local_sessions then + -- not a VirtualHost, no user sessions + return + end local reason = event.reason; -- Close smacks-enaled sessions ourselves instead of letting mod_c2s close -- it, which invalidates the smacks session. This allows preserving the