Comparison

plugins/mod_s2s/mod_s2s.lua @ 4960:8950510ddb2e

mod_s2s: Make unauthed session timeout a little more aggressive... otherwise it's possible for sessions to slip under the net and never get killed off
author Matthew Wild <mwild1@gmail.com>
date Sun, 22 Jul 2012 16:45:27 +0100
parent 4906:89df1f03546a
child 4968:a6d3ac11a7af
comparison
equal deleted inserted replaced
4959:ab696f5394cf 4960:8950510ddb2e
411 local handlestanza = stream_callbacks.handlestanza; 411 local handlestanza = stream_callbacks.handlestanza;
412 function session.dispatch_stanza(session, stanza) 412 function session.dispatch_stanza(session, stanza)
413 return handlestanza(session, stanza); 413 return handlestanza(session, stanza);
414 end 414 end
415 415
416 local conn = session.conn;
417 add_task(connect_timeout, function () 416 add_task(connect_timeout, function ()
418 if session.conn ~= conn or session.connecting 417 if session.type == "s2sin" or session.type == "s2sout" then
419 or session.type == "s2sin" or session.type == "s2sout" then 418 return; -- Ok, we're connected
420 return; -- Ok, we're connect[ed|ing]
421 end 419 end
422 -- Not connected, need to close session and clean up 420 -- Not connected, need to close session and clean up
423 (session.log or log)("debug", "Destroying incomplete session %s->%s due to inactivity", 421 (session.log or log)("debug", "Destroying incomplete session %s->%s due to inactivity",
424 session.from_host or "(unknown)", session.to_host or "(unknown)"); 422 session.from_host or "(unknown)", session.to_host or "(unknown)");
425 session:close("connection-timeout"); 423 session:close("connection-timeout");