Comparison

plugins/mod_s2s.lua @ 12493:e9ea5c88def0

mod_s2s: Don't bounce queued error stanzas (thanks Martin) The check for the type attr was lost in 11765f0605ec leading to attempts to create error replies for error stanzas, which util.stanza rejects. Tested by sending <message to="reject.badxmpp.eu" type="error"><error/></message> which produced a traceback previously.
author Kim Alvefur <zash@zash.se>
date Sat, 07 May 2022 13:01:49 +0200
parent 12480:7e9ebdc75ce4
child 12494:65316782862f
comparison
equal deleted inserted replaced
12492:a44c328028ad 12493:e9ea5c88def0
145 error_type, condition, reason_text = reason.type, reason.condition, reason.text; 145 error_type, condition, reason_text = reason.type, reason.condition, reason.text;
146 elseif type(reason) == "string" then 146 elseif type(reason) == "string" then
147 reason_text = reason; 147 reason_text = reason;
148 end 148 end
149 for i, stanza in ipairs(sendq) do 149 for i, stanza in ipairs(sendq) do
150 if not stanza.attr.xmlns and bouncy_stanzas[stanza.name] then 150 if not stanza.attr.xmlns and bouncy_stanzas[stanza.name] and stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then
151 local reply = st.error_reply( 151 local reply = st.error_reply(
152 stanza, 152 stanza,
153 error_type, 153 error_type,
154 condition, 154 condition,
155 reason_text and ("Server-to-server connection failed: "..reason_text) or nil 155 reason_text and ("Server-to-server connection failed: "..reason_text) or nil