Comparison

plugins/mod_s2s/mod_s2s.lua @ 5307:d80e56d8805c

mod_s2s: Don't try to close sessions that were destroyed before timeout
author Kim Alvefur <zash@zash.se>
date Thu, 24 Jan 2013 00:59:32 +0100
parent 5281:815c689f85ad
child 5341:760c22c822be
comparison
equal deleted inserted replaced
5306:10bc0e2aa55e 5307:d80e56d8805c
427 end 427 end
428 428
429 add_task(connect_timeout, function () 429 add_task(connect_timeout, function ()
430 if session.type == "s2sin" or session.type == "s2sout" then 430 if session.type == "s2sin" or session.type == "s2sout" then
431 return; -- Ok, we're connected 431 return; -- Ok, we're connected
432 elseif session.type == "s2s_destroyed" then
433 return; -- Session already destroyed
432 end 434 end
433 -- Not connected, need to close session and clean up 435 -- Not connected, need to close session and clean up
434 (session.log or log)("debug", "Destroying incomplete session %s->%s due to inactivity", 436 (session.log or log)("debug", "Destroying incomplete session %s->%s due to inactivity",
435 session.from_host or "(unknown)", session.to_host or "(unknown)"); 437 session.from_host or "(unknown)", session.to_host or "(unknown)");
436 session:close("connection-timeout"); 438 session:close("connection-timeout");