# HG changeset patch # User Marco Cirillo # Date 1330097796 0 # Node ID aba47e6dff433930324defcc3be145ecb5d124de # Parent 32d532b95dc70420439b3a9639682562f1258f77 mod_s2s: prevent attempting to reconnect when the stream is gracefully closed and fix TB by checking session.conn is set (racy racy?) diff -r 32d532b95dc7 -r aba47e6dff43 plugins/s2s/mod_s2s.lua --- a/plugins/s2s/mod_s2s.lua Fri Feb 24 15:35:04 2012 +0000 +++ b/plugins/s2s/mod_s2s.lua Fri Feb 24 15:36:36 2012 +0000 @@ -247,7 +247,7 @@ 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 @@ 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