return;
end
- -- Store the original host (this is used for config, etc.)
- session.user = attr.to;
- -- Set the host for future reference
- session.host = config.get(attr.to, "core", "component_address") or attr.to;
-- Note that we don't create the internal component
-- until after the external component auths successfully
+ session.host = attr.to;
session.streamid = uuid_gen();
session.notopen = nil;
end
function stream_callbacks.streamclosed(session)
- session.log("Received </stream:stream>");
+ session.log("debug", "Received </stream:stream>");
session:close();
end
local session = sessions[conn];
if session then
(session.log or log)("info", "component disconnected: %s (%s)", tostring(session.host), tostring(err));
- if session.host then
+ if hosts[session.host] then
log("debug", "Deregistering component");
cm_deregister_component(session.host);
hosts[session.host].connected = nil;