80 |
80 |
81 module:hook_stanza(xmlns_sm, "a", function (origin, stanza) |
81 module:hook_stanza(xmlns_sm, "a", function (origin, stanza) |
82 if not origin.smacks then return; end |
82 if not origin.smacks then return; end |
83 origin.awaiting_ack = nil; |
83 origin.awaiting_ack = nil; |
84 -- Remove handled stanzas from outgoing_stanza_queue |
84 -- Remove handled stanzas from outgoing_stanza_queue |
|
85 --log("debug", "ACK: h=%s, last=%s", stanza.attr.h or "", origin.last_acknowledged_stanza or ""); |
85 local handled_stanza_count = tonumber(stanza.attr.h)-origin.last_acknowledged_stanza; |
86 local handled_stanza_count = tonumber(stanza.attr.h)-origin.last_acknowledged_stanza; |
86 local queue = origin.outgoing_stanza_queue; |
87 local queue = origin.outgoing_stanza_queue; |
87 if handled_stanza_count > #queue then |
88 if handled_stanza_count > #queue then |
88 module:log("warn", "The client says it handled %d new stanzas, but we only sent %d :)", |
89 module:log("warn", "The client says it handled %d new stanzas, but we only sent %d :)", |
89 handled_stanza_count, #queue); |
90 handled_stanza_count, #queue); |