Mercurial > prosody-hg
comparison core/sessionmanager.lua @ 125:6b6b8f4ab7e3
even faster checking for other sessions... thank you waqas :)
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 23 Oct 2008 17:34:10 +0100 |
| parents | 7fee6b63abca |
| children | 63863534b1f1 |
comparison
equal
deleted
inserted
replaced
| 124:7fee6b63abca | 125:6b6b8f4ab7e3 |
|---|---|
| 37 session.log("info", "Destroying session"); | 37 session.log("info", "Destroying session"); |
| 38 if session.username then | 38 if session.username then |
| 39 if session.resource then | 39 if session.resource then |
| 40 hosts[session.host].sessions[session.username].sessions[session.resource] = nil; | 40 hosts[session.host].sessions[session.username].sessions[session.resource] = nil; |
| 41 end | 41 end |
| 42 local nomore = true; | 42 if not next(hosts[session.host].sessions[session.username], nil) then |
| 43 for res, ssn in pairs(hosts[session.host].sessions[session.username]) do | |
| 44 nomore = false; | |
| 45 break; | |
| 46 end | |
| 47 if nomore then | |
| 48 hosts[session.host].sessions[session.username] = nil; | 43 hosts[session.host].sessions[session.username] = nil; |
| 49 end | 44 end |
| 50 end | 45 end |
| 51 session.conn = nil; | 46 session.conn = nil; |
| 52 session.disconnect = nil; | 47 session.disconnect = nil; |
