aboutsummaryrefslogtreecommitdiffstats
path: root/core/s2smanager.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-11-23 01:29:03 +0100
committerKim Alvefur <zash@zash.se>2019-11-23 01:29:03 +0100
commit4a9bb8c321af1127e1ff7caa8f05cc97a60c4566 (patch)
tree60f04ed9cdc074643bcc84b932c83ce8b120ea45 /core/s2smanager.lua
parentb1d048f1177a4f6b2971510dd83184c6db8bbb38 (diff)
downloadprosody-4a9bb8c321af1127e1ff7caa8f05cc97a60c4566.tar.gz
prosody-4a9bb8c321af1127e1ff7caa8f05cc97a60c4566.zip
s2s: Allow passing a custom error for bouncing queued stanzas (#770)
Since stream errors and stanza errors are different
Diffstat (limited to 'core/s2smanager.lua')
-rw-r--r--core/s2smanager.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index 7471286c..7f156f12 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -84,14 +84,14 @@ local function retire_session(session, reason)
return setmetatable(session, resting_session);
end
-local function destroy_session(session, reason)
+local function destroy_session(session, reason, bounce_reason)
if session.destroyed then return; end
local log = session.log or log;
log("debug", "Destroying %s session %s->%s%s%s", session.direction, session.from_host, session.to_host, reason and ": " or "", reason or "");
if session.direction == "outgoing" then
hosts[session.from_host].s2sout[session.to_host] = nil;
- session:bounce_sendq(reason);
+ session:bounce_sendq(bounce_reason or reason);
elseif session.direction == "incoming" then
if session.outgoing then
hosts[session.to_host].s2sout[session.from_host] = nil;