aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-05-29 06:51:52 +0200
committerKim Alvefur <zash@zash.se>2018-05-29 06:51:52 +0200
commit6fca546a68e5316421cd23f5b7763e3670895b2f (patch)
tree6a95f0550bc0e7c2c633e42123c082cc9b83aba3 /core
parentee9861460c1fbee1edefb7b22822d3d33a159142 (diff)
downloadprosody-6fca546a68e5316421cd23f5b7763e3670895b2f.tar.gz
prosody-6fca546a68e5316421cd23f5b7763e3670895b2f.zip
sessionmanager: Generate shorter random resoures
Diffstat (limited to 'core')
-rw-r--r--core/sessionmanager.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua
index c9d4bce4..2b429df9 100644
--- a/core/sessionmanager.lua
+++ b/core/sessionmanager.lua
@@ -20,7 +20,7 @@ local rm_load_roster = require "core.rostermanager".load_roster;
local config_get = require "core.configmanager".get;
local resourceprep = require "util.encodings".stringprep.resourceprep;
local nodeprep = require "util.encodings".stringprep.nodeprep;
-local uuid_generate = require "util.uuid".generate;
+local generate_identifier = require "util.id".short;
local initialize_filters = require "util.filters".initialize;
local gettime = require "socket".gettime;
@@ -138,7 +138,7 @@ local function bind_resource(session, resource)
end
resource = resourceprep(resource);
- resource = resource ~= "" and resource or uuid_generate();
+ resource = resource ~= "" and resource or generate_identifier();
--FIXME: Randomly-generated resources must be unique per-user, and never conflict with existing
if not hosts[session.host].sessions[session.username] then
@@ -152,7 +152,7 @@ local function bind_resource(session, resource)
local policy = config_get(session.host, "conflict_resolve");
local increment;
if policy == "random" then
- resource = uuid_generate();
+ resource = generate_identifier();
increment = true;
elseif policy == "increment" then
increment = true; -- TODO ping old resource