Mercurial > prosody-hg
comparison core/s2smanager.lua @ 2877:1edeb8fe7d14
Merge 0.6.2/waqas with 0.6.2/MattJ
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 03 Mar 2010 22:05:05 +0000 |
| parents | 46dfcc33ea9e d08771a2f617 |
| children | c1e6df7cf56a |
comparison
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; |
