plugins/mod_console.lua

changeset 1823
7c3ec7ac6316
parent 1799
c9c1987430c6
parent 1821
05ed826da89b
child 1908
27c1c6e6c583
equal deleted inserted replaced
1819:ed1911be26c7 1823:7c3ec7ac6316
513 -- Is an outgoing connection 513 -- Is an outgoing connection
514 local session = hosts[from].s2sout[to]; 514 local session = hosts[from].s2sout[to];
515 if not session then 515 if not session then
516 print("No outgoing connection from "..from.." to "..to) 516 print("No outgoing connection from "..from.." to "..to)
517 else 517 else
518 s2smanager.destroy_session(session); 518 (session.close or s2smanager.destroy_session)(session);
519 count = count + 1; 519 count = count + 1;
520 print("Closed outgoing session from "..from.." to "..to); 520 print("Closed outgoing session from "..from.." to "..to);
521 end 521 end
522 elseif hosts[to] and not hosts[from] then 522 elseif hosts[to] and not hosts[from] then
523 -- Is an incoming connection 523 -- Is an incoming connection
524 for session in pairs(incoming_s2s) do 524 for session in pairs(incoming_s2s) do
525 if session.to_host == to and session.from_host == from then 525 if session.to_host == to and session.from_host == from then
526 s2smanager.destroy_session(session); 526 (session.close or s2smanager.destroy_session)(session);
527 count = count + 1; 527 count = count + 1;
528 end 528 end
529 end 529 end
530 530
531 if count == 0 then 531 if count == 0 then

mercurial