Comparison

core/sessionmanager.lua @ 644:e1b3a472ca00

Automated merge with http://waqas.ath.cx:8000/
author Matthew Wild <mwild1@gmail.com>
date Thu, 25 Dec 2008 01:37:13 +0000
parent 623:5af5a64a729f
child 694:b97b05261156
comparison
equal deleted inserted replaced
643:8ff454831f7d 644:e1b3a472ca00
111 function bind_resource(session, resource) 111 function bind_resource(session, resource)
112 if not session.username then return nil, "auth", "not-authorized", "Cannot bind resource before authentication"; end 112 if not session.username then return nil, "auth", "not-authorized", "Cannot bind resource before authentication"; end
113 if session.resource then return nil, "cancel", "already-bound", "Cannot bind multiple resources on a single connection"; end 113 if session.resource then return nil, "cancel", "already-bound", "Cannot bind multiple resources on a single connection"; end
114 -- We don't support binding multiple resources 114 -- We don't support binding multiple resources
115 115
116 session.conntimetotal = gettime()-session.conntime;
117
118 resource = resource or uuid_generate(); 116 resource = resource or uuid_generate();
119 --FIXME: Randomly-generated resources must be unique per-user, and never conflict with existing 117 --FIXME: Randomly-generated resources must be unique per-user, and never conflict with existing
120 118
121 if not hosts[session.host].sessions[session.username] then 119 if not hosts[session.host].sessions[session.username] then
122 hosts[session.host].sessions[session.username] = { sessions = {} }; 120 hosts[session.host].sessions[session.username] = { sessions = {} };