Skip to content

Commit

Permalink
mod_s2s: fixes #533...
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
maranda committed Oct 2, 2021
1 parent 967d73e commit 627e796
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/mod_s2s/mod_s2s.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 627e796

Please sign in to comment.