# HG changeset patch # User Kim Alvefur # Date 1614774398 -3600 # Node ID f84005d06663b6d06cbd676a2035e694cb3f855e # Parent 0a9d6eec6a8f4be16fdbd8c50e985a6f97e82664 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. diff -r 0a9d6eec6a8f -r f84005d06663 plugins/mod_s2s.lua --- 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 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...");