core/s2smanager.lua

changeset 2877
1edeb8fe7d14
parent 2813
46dfcc33ea9e
parent 2858
d08771a2f617
child 2889
c1e6df7cf56a
equal deleted inserted replaced
2813:46dfcc33ea9e 2877:1edeb8fe7d14
502 502
503 session.srv_hosts = nil; 503 session.srv_hosts = nil;
504 end 504 end
505 end 505 end
506 506
507 local function null_data_handler(conn, data) log("debug", "Discarding data from destroyed s2s session: %s", data); end
508
507 function destroy_session(session, reason) 509 function destroy_session(session, reason)
508 (session.log or log)("info", "Destroying "..tostring(session.direction).." session "..tostring(session.from_host).."->"..tostring(session.to_host)); 510 (session.log or log)("info", "Destroying "..tostring(session.direction).." session "..tostring(session.from_host).."->"..tostring(session.to_host));
509 511
510 if session.direction == "outgoing" then 512 if session.direction == "outgoing" then
511 hosts[session.from_host].s2sout[session.to_host] = nil; 513 hosts[session.from_host].s2sout[session.to_host] = nil;
517 for k in pairs(session) do 519 for k in pairs(session) do
518 if k ~= "trace" then 520 if k ~= "trace" then
519 session[k] = nil; 521 session[k] = nil;
520 end 522 end
521 end 523 end
524 session.data = null_data_handler;
522 end 525 end
523 526
524 return _M; 527 return _M;

mercurial