Software /
code /
prosody-modules
Comparison
mod_smacks/mod_smacks.lua @ 3477:1f2381492c9f
mod_smacks: no crash on <a> without @h, fix #1317
author | Georg Lukas <georg@op-co.de> |
---|---|
date | Wed, 06 Mar 2019 21:25:47 +0100 |
parent | 3450:9b6206f23151 |
child | 3478:f6319346e2a3 |
comparison
equal
deleted
inserted
replaced
3476:4ce945490a24 | 3477:1f2381492c9f |
---|---|
342 -- Remove handled stanzas from outgoing_stanza_queue | 342 -- Remove handled stanzas from outgoing_stanza_queue |
343 -- origin.log("debug", "ACK: h=%s, last=%s", stanza.attr.h or "", origin.last_acknowledged_stanza or ""); | 343 -- origin.log("debug", "ACK: h=%s, last=%s", stanza.attr.h or "", origin.last_acknowledged_stanza or ""); |
344 local h = tonumber(stanza.attr.h); | 344 local h = tonumber(stanza.attr.h); |
345 if not h then | 345 if not h then |
346 origin:close{ condition = "invalid-xml"; text = "Missing or invalid 'h' attribute"; }; | 346 origin:close{ condition = "invalid-xml"; text = "Missing or invalid 'h' attribute"; }; |
347 return; | |
347 end | 348 end |
348 local handled_stanza_count = h-origin.last_acknowledged_stanza; | 349 local handled_stanza_count = h-origin.last_acknowledged_stanza; |
349 local queue = origin.outgoing_stanza_queue; | 350 local queue = origin.outgoing_stanza_queue; |
350 if handled_stanza_count > #queue then | 351 if handled_stanza_count > #queue then |
351 origin.log("warn", "The client says it handled %d new stanzas, but we only sent %d :)", | 352 origin.log("warn", "The client says it handled %d new stanzas, but we only sent %d :)", |