Software /
code /
prosody
Comparison
plugins/mod_smacks.lua @ 12078:2c13aaae35ac
mod_smacks: Fix typos
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 20 Dec 2021 00:06:47 +0100 |
parent | 12077:061d516d8ac5 |
child | 12080:9744a0ceb767 |
comparison
equal
deleted
inserted
replaced
12077:061d516d8ac5 | 12078:2c13aaae35ac |
---|---|
114 local expected_h = session.last_acknowledged_stanza + queue:count_unacked(); | 114 local expected_h = session.last_acknowledged_stanza + queue:count_unacked(); |
115 local max_unacked = max_unacked_stanzas; | 115 local max_unacked = max_unacked_stanzas; |
116 if session.state == "inactive" then | 116 if session.state == "inactive" then |
117 max_unacked = max_inactive_unacked_stanzas; | 117 max_unacked = max_inactive_unacked_stanzas; |
118 end | 118 end |
119 -- this check of last_requested_h prevents ack-loops if missbehaving clients report wrong | 119 -- this check of last_requested_h prevents ack-loops if misbehaving clients report wrong |
120 -- stanza counts. it is set when an <r> is really sent (e.g. inside timer), preventing any | 120 -- stanza counts. it is set when an <r> is really sent (e.g. inside timer), preventing any |
121 -- further requests until a higher h-value would be expected. | 121 -- further requests until a higher h-value would be expected. |
122 return queue:count_unacked() > max_unacked and expected_h ~= session.last_requested_h; | 122 return queue:count_unacked() > max_unacked and expected_h ~= session.last_requested_h; |
123 end | 123 end |
124 | 124 |
633 if not local_sessions then | 633 if not local_sessions then |
634 -- not a VirtualHost, no user sessions | 634 -- not a VirtualHost, no user sessions |
635 return | 635 return |
636 end | 636 end |
637 local reason = event.reason; | 637 local reason = event.reason; |
638 -- Close smacks-enaled sessions ourselves instead of letting mod_c2s close | 638 -- Close smacks-enabled sessions ourselves instead of letting mod_c2s close |
639 -- it, which invalidates the smacks session. This allows preserving the | 639 -- it, which invalidates the smacks session. This allows preserving the |
640 -- counter value, so it can be communicated to the client when it tries to | 640 -- counter value, so it can be communicated to the client when it tries to |
641 -- resume the lost session after a restart. | 641 -- resume the lost session after a restart. |
642 for _, user in pairs(local_sessions) do | 642 for _, user in pairs(local_sessions) do |
643 for _, session in pairs(user.sessions) do | 643 for _, session in pairs(user.sessions) do |