Mercurial > prosody-modules
comparison mod_smacks/mod_smacks.lua @ 4760:367a8020bd92
mod_smacks: Don't forgive client counting errors
author | tmolitor <thilo@eightysoft.de> |
---|---|
date | Sun, 07 Nov 2021 14:40:41 +0100 |
parents | edbd84bbd8fb |
children | e227af629736 |
comparison
equal
deleted
inserted
replaced
4757:8e22b858628f | 4760:367a8020bd92 |
---|---|
385 handled_stanza_count, #queue); | 385 handled_stanza_count, #queue); |
386 origin.log("debug", "Client h: %d, our h: %d", tonumber(stanza.attr.h), origin.last_acknowledged_stanza); | 386 origin.log("debug", "Client h: %d, our h: %d", tonumber(stanza.attr.h), origin.last_acknowledged_stanza); |
387 for i=1,#queue do | 387 for i=1,#queue do |
388 origin.log("debug", "Q item %d: %s", i, tostring(queue[i])); | 388 origin.log("debug", "Q item %d: %s", i, tostring(queue[i])); |
389 end | 389 end |
390 origin:close{ condition = "undefined-condition"; text = "Client acknowledged more stanzas than sent by server"; }; | |
391 return; | |
390 end | 392 end |
391 | 393 |
392 for i=1,math_min(handled_stanza_count,#queue) do | 394 for i=1,math_min(handled_stanza_count,#queue) do |
393 local handled_stanza = t_remove(origin.outgoing_stanza_queue, 1); | 395 local handled_stanza = t_remove(origin.outgoing_stanza_queue, 1); |
394 module:fire_event("delivery/success", { session = origin, stanza = handled_stanza }); | 396 module:fire_event("delivery/success", { session = origin, stanza = handled_stanza }); |