aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-03-03 13:26:38 +0100
committerKim Alvefur <zash@zash.se>2021-03-03 13:26:38 +0100
commit494b53ce0b5167d89f80c41dbc69fe8af6836f82 (patch)
treeba61e3db73adec0ab90aae47a21bf98e8a6d0204
parent9f53eecfa48f442f2987d7d137f1f90a59e66f4b (diff)
downloadprosody-494b53ce0b5167d89f80c41dbc69fe8af6836f82.tar.gz
prosody-494b53ce0b5167d89f80c41dbc69fe8af6836f82.zip
mod_s2s: Check direction in bidi-aware style
Both session.incoming and session.outgoing are truthy here, but session.direction indicates the "real" direction in the way that matters for the order of events when opening or closing streams.
-rw-r--r--plugins/mod_s2s.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_s2s.lua b/plugins/mod_s2s.lua
index 5a629a90..3d4506bf 100644
--- a/plugins/mod_s2s.lua
+++ b/plugins/mod_s2s.lua
@@ -542,7 +542,7 @@ local function session_close(session, reason, remote_reason, bounce_reason)
-- Authenticated incoming stream may still be sending us stanzas, so wait for </stream:stream> from remote
local conn = session.conn;
- if reason == nil and not session.notopen and session.incoming then
+ if reason == nil and not session.notopen and session.direction == "incoming" then
add_task(stream_close_timeout, function ()
if not session.destroyed then
session.log("warn", "Failed to receive a stream close response, closing connection anyway...");