Mercurial > prosody-hg
comparison plugins/mod_smacks.lua @ 14147:320e1d49aa9e
Merge 13.0->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 21 Apr 2026 16:23:34 +0100 |
| parents | 1d028f9473c2 |
| children |
comparison
equal
deleted
inserted
replaced
| 14145:b6b09dace24b | 14147:320e1d49aa9e |
|---|---|
| 73 local max_unacked_stanzas = module:get_option_integer("smacks_max_unacked_stanzas", 0, 0); | 73 local max_unacked_stanzas = module:get_option_integer("smacks_max_unacked_stanzas", 0, 0); |
| 74 local max_inactive_unacked_stanzas = module:get_option_integer("smacks_max_inactive_unacked_stanzas", 256, 0); | 74 local max_inactive_unacked_stanzas = module:get_option_integer("smacks_max_inactive_unacked_stanzas", 256, 0); |
| 75 local delayed_ack_timeout = module:get_option_period("smacks_max_ack_delay", 30); | 75 local delayed_ack_timeout = module:get_option_period("smacks_max_ack_delay", 30); |
| 76 local max_old_sessions = module:get_option_integer("smacks_max_old_sessions", 10, 0); | 76 local max_old_sessions = module:get_option_integer("smacks_max_old_sessions", 10, 0); |
| 77 | 77 |
| 78 local c2s_sessions = module:shared("/*/c2s/sessions"); | |
| 79 local local_sessions = prosody.hosts[module.host].sessions; | 78 local local_sessions = prosody.hosts[module.host].sessions; |
| 80 | 79 |
| 81 local function format_h(h) if h then return string.format("%d", h) end end | 80 local function format_h(h) if h then return string.format("%d", h) end end |
| 82 | 81 |
| 83 local all_old_sessions = module:open_store("smacks_h"); | 82 local all_old_sessions = module:open_store("smacks_h"); |
| 552 sessions_expired(1); | 551 sessions_expired(1); |
| 553 end; | 552 end; |
| 554 }); | 553 }); |
| 555 end); | 554 end); |
| 556 if session.conn then | 555 if session.conn then |
| 557 local conn = session.conn; | 556 session.conn:close(); |
| 558 c2s_sessions[conn] = nil; | |
| 559 session.conn = nil; | |
| 560 conn:close(); | |
| 561 end | 557 end |
| 562 session.log("debug", "Session going into hibernation (not being destroyed)") | 558 session.log("debug", "Session going into hibernation (not being destroyed)") |
| 563 module:fire_event("smacks-hibernation-start", { origin = session; queue = session.outgoing_stanza_queue:table() }); | 559 module:fire_event("smacks-hibernation-start", { origin = session; queue = session.outgoing_stanza_queue:table() }); |
| 564 return true; -- Postpone destruction for now | 560 return true; -- Postpone destruction for now |
| 565 end); | 561 end); |
