Software /
code /
prosody
Comparison
plugins/mod_smacks.lua @ 12550:12962a1001c2
Merge 0.12->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 13 Jun 2022 19:17:36 +0200 |
parent | 12528:8e780079a424 |
parent | 12549:3729a6bdb562 |
child | 12677:3b9771d496ed |
comparison
equal
deleted
inserted
replaced
12548:5133d6e48686 | 12550:12962a1001c2 |
---|---|
171 end | 171 end |
172 | 172 |
173 local function request_ack(session, reason) | 173 local function request_ack(session, reason) |
174 local queue = session.outgoing_stanza_queue; | 174 local queue = session.outgoing_stanza_queue; |
175 session.log("debug", "Sending <r> from %s - #queue=%d", reason, queue:count_unacked()); | 175 session.log("debug", "Sending <r> from %s - #queue=%d", reason, queue:count_unacked()); |
176 session.awaiting_ack = true; | |
176 (session.sends2s or session.send)(st.stanza("r", { xmlns = session.smacks })) | 177 (session.sends2s or session.send)(st.stanza("r", { xmlns = session.smacks })) |
177 if session.destroyed then return end -- sending something can trigger destruction | 178 if session.destroyed then return end -- sending something can trigger destruction |
178 session.awaiting_ack = true; | |
179 -- expected_h could be lower than this expression e.g. more stanzas added to the queue meanwhile) | 179 -- expected_h could be lower than this expression e.g. more stanzas added to the queue meanwhile) |
180 session.last_requested_h = queue:count_acked() + queue:count_unacked(); | 180 session.last_requested_h = queue:count_acked() + queue:count_unacked(); |
181 if not session.delayed_ack_timer then | 181 if not session.delayed_ack_timer then |
182 session.delayed_ack_timer = timer.add_task(delayed_ack_timeout, function() | 182 session.delayed_ack_timer = timer.add_task(delayed_ack_timeout, function() |
183 ack_delayed(session, nil); -- we don't know if this is the only new stanza in the queue | 183 ack_delayed(session, nil); -- we don't know if this is the only new stanza in the queue |