Software /
code /
prosody
Diff
plugins/mod_s2s.lua @ 11417:f84005d06663
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.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 03 Mar 2021 13:26:38 +0100 |
parent | 11415:a38f9e09ca31 |
child | 11419:2c26dfc1977f |
line wrap: on
line diff
--- a/plugins/mod_s2s.lua Tue Mar 02 22:57:20 2021 +0100 +++ b/plugins/mod_s2s.lua Wed Mar 03 13:26:38 2021 +0100 @@ -542,7 +542,7 @@ -- 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...");