mirror of
https://github.com/bjc/prosody.git
synced 2025-04-06 22:57:38 +03:00
mod_s2s: prevent attempting to reconnect when the stream is gracefully closed and fix TB by checking session.conn is set (racy racy?)
This commit is contained in:
parent
f04b6b3bad
commit
0f9c104f0c
1 changed files with 2 additions and 2 deletions
|
@ -247,7 +247,7 @@ function stream_callbacks.streamclosed(session)
|
||||||
end
|
end
|
||||||
|
|
||||||
function stream_callbacks.streamdisconnected(session, err)
|
function stream_callbacks.streamdisconnected(session, err)
|
||||||
if err and err ~= "closed" then
|
if err and err ~= "stream closed" then
|
||||||
(session.log or log)("debug", "s2s connection attempt failed: %s", err);
|
(session.log or log)("debug", "s2s connection attempt failed: %s", err);
|
||||||
if s2sout.attempt_connection(session, err) then
|
if s2sout.attempt_connection(session, err) then
|
||||||
(session.log or log)("debug", "...so we're going to try another target");
|
(session.log or log)("debug", "...so we're going to try another target");
|
||||||
|
@ -255,7 +255,7 @@ function stream_callbacks.streamdisconnected(session, err)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
(session.log or log)("info", "s2s disconnected: %s->%s (%s)", tostring(session.from_host), tostring(session.to_host), tostring(err or "closed"));
|
(session.log or log)("info", "s2s disconnected: %s->%s (%s)", tostring(session.from_host), tostring(session.to_host), tostring(err or "closed"));
|
||||||
sessions[session.conn] = nil;
|
if session.con then sessions[session.conn] = nil; else (session.log or log)("debug", "stale session's connection already closed"); end
|
||||||
s2s_destroy_session(session, err);
|
s2s_destroy_session(session, err);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue