From 627e7962b53974cf2ad3cb6815ae7c04d0ea04da Mon Sep 17 00:00:00 2001 From: Marco Cirillo Date: Sat, 2 Oct 2021 21:26:26 +0200 Subject: [PATCH] mod_s2s: fixes #533... Throwing error() within s2s code will propagate badly within the server backend causing the socket to linger unhandled and Metronome to crash, we shall properly handle and the exception and not interrupt code execution. --- plugins/mod_s2s/mod_s2s.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index b3fc24e6..14dd0348 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -367,7 +367,11 @@ function stream_callbacks.streamopened(session, attr) end elseif session.direction == "outgoing" then -- If we are just using the connection for verifying dialback keys, we won't try and auth it - if not attr.id then error("stream response did not give us a streamid!!!"); end + if not attr.id then + log("error", "stream response did not give us a streamid!"); + session:close({ condition = "undefined-condition", text = "ID on the stream response is missing" }); + return; + end session.streamid = attr.id; -- If server is pre-1.0, don't wait for features, just do dialback