129 |
129 |
130 function xmppserver.disconnect(conn, err) |
130 function xmppserver.disconnect(conn, err) |
131 local session = sessions[conn]; |
131 local session = sessions[conn]; |
132 if session then |
132 if session then |
133 if err and err ~= "closed" and session.srv_hosts then |
133 if err and err ~= "closed" and session.srv_hosts then |
|
134 (session.log or log)("debug", "s2s connection closed unexpectedly"); |
134 if s2s_attempt_connect(session, err) then |
135 if s2s_attempt_connect(session, err) then |
|
136 (session.log or log)("debug", "...so we're going to try again"); |
135 return; -- Session lives for now |
137 return; -- Session lives for now |
136 end |
138 end |
137 end |
139 end |
138 (session.log or log)("info", "s2s disconnected: %s->%s (%s)", tostring(session.from_host), tostring(session.to_host), tostring(err)); |
140 (session.log or log)("info", "s2s disconnected: %s->%s (%s)", tostring(session.from_host), tostring(session.to_host), tostring(err)); |
139 s2s_destroy_session(session); |
141 s2s_destroy_session(session); |