Diff

plugins/mod_s2s/mod_s2s.lua @ 10425:42cf93ff4618

s2s: Allow passing a custom error for bouncing queued stanzas (#770) Since stream errors and stanza errors are different
author Kim Alvefur <zash@zash.se>
date Sat, 23 Nov 2019 01:29:03 +0100
parent 10421:09b54ad0fdc4
child 10426:dd4eb84d92a8
line wrap: on
line diff
--- a/plugins/mod_s2s/mod_s2s.lua	Wed Nov 20 21:31:46 2019 +0100
+++ b/plugins/mod_s2s/mod_s2s.lua	Sat Nov 23 01:29:03 2019 +0100
@@ -487,7 +487,7 @@
 
 --- Session methods
 local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'};
-local function session_close(session, reason, remote_reason)
+local function session_close(session, reason, remote_reason, bounce_reason)
 	local log = session.log or log;
 	if session.conn then
 		if session.notopen then
@@ -537,12 +537,12 @@
 			add_task(stream_close_timeout, function ()
 				if not session.destroyed then
 					session.log("warn", "Failed to receive a stream close response, closing connection anyway...");
-					s2s_destroy_session(session, reason);
+					s2s_destroy_session(session, reason, bounce_reason);
 					conn:close();
 				end
 			end);
 		else
-			s2s_destroy_session(session, reason);
+			s2s_destroy_session(session, reason, bounce_reason);
 			conn:close(); -- Close immediately, as this is an outgoing connection or is not authed
 		end
 	end