X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=core%2Fs2smanager.lua;h=602d6837bc1a9bd23471921dd09cdb8f7d1cbaf8;hb=d9d7b3b54a04323c0fa4df17523cafea3d3b00ae;hp=d8ceb4efeb17ca58694a4d0a611cf6f39bd693ca;hpb=332ebda71d7fa4771a8222664b3b8bf341109432;p=prosody.git diff --git a/core/s2smanager.lua b/core/s2smanager.lua index d8ceb4ef..602d6837 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -389,7 +389,7 @@ function streamopened(session, attr) local features = st.stanza("stream:features"); if session.to_host then - hosts[session.to_host].events.fire_event("s2s-stream-features", { session = session, features = features }); + hosts[session.to_host].events.fire_event("s2s-stream-features", { origin = session, features = features }); else (session.log or log)("warn", "No 'to' on stream header from %s means we can't offer any features", session.from_host or "unknown host"); end @@ -508,6 +508,8 @@ function mark_connected(session) end end +local function null_data_handler(conn, data) log("debug", "Discarding data from destroyed s2s session: %s", data); end + function destroy_session(session, reason) (session.log or log)("info", "Destroying "..tostring(session.direction).." session "..tostring(session.from_host).."->"..tostring(session.to_host)); @@ -523,6 +525,7 @@ function destroy_session(session, reason) session[k] = nil; end end + session.data = null_data_handler; end return _M;