aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMarco Cirillo <maranda@lightwitch.org>2012-02-24 15:36:36 +0000
committerMarco Cirillo <maranda@lightwitch.org>2012-02-24 15:36:36 +0000
commit39a677bc8af8e6e97e896afb72e986ae7cbb9a7e (patch)
tree902c3772ff4abab573db2892a371739668f37b93 /plugins
parentb6a8fd9f6b060324897dc9f4f6a80c706e4ba399 (diff)
downloadprosody-39a677bc8af8e6e97e896afb72e986ae7cbb9a7e.tar.gz
prosody-39a677bc8af8e6e97e896afb72e986ae7cbb9a7e.zip
mod_s2s: prevent attempting to reconnect when the stream is gracefully closed and fix TB by checking session.conn is set (racy racy?)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/s2s/mod_s2s.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/s2s/mod_s2s.lua b/plugins/s2s/mod_s2s.lua
index 88e8cded..d1fdedb3 100644
--- a/plugins/s2s/mod_s2s.lua
+++ b/plugins/s2s/mod_s2s.lua
@@ -247,7 +247,7 @@ function stream_callbacks.streamclosed(session)
end
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);
if s2sout.attempt_connection(session, err) then
(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
(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);
end