# HG changeset patch # User Kim Alvefur # Date 1640195265 -3600 # Node ID 08a949e63541fa7dcf9873fce3804da66a2fbebb # Parent f8d28021563370b9b165ee0535883d09372950cc mod_smacks: Use more compact resumption tokens UUID seems like insane overkill for something user-scoped and not security-sensitive. All that is needed is to avoid conflicts among what should be relatively long-lived sessions. diff -r f8d280215633 -r 08a949e63541 plugins/mod_smacks.lua --- a/plugins/mod_smacks.lua Thu Dec 02 00:13:23 2021 +0100 +++ b/plugins/mod_smacks.lua Wed Dec 22 18:47:45 2021 +0100 @@ -21,7 +21,7 @@ local smqueue = require "util.smqueue"; local st = require "util.stanza"; local timer = require "util.timer"; -local uuid_generate = require "util.uuid".generate; +local new_id = require "util.id".short; local watchdog = require "util.watchdog"; local sessionmanager = require "core.sessionmanager"; @@ -259,7 +259,7 @@ local resume_token; local resume = stanza.attr.resume; if resume == "true" or resume == "1" then - resume_token = uuid_generate(); + resume_token = new_id(); session_registry[jid.join(session.username, session.host, resume_token)] = session; session.resumption_token = resume_token; resume_max = tostring(resume_timeout);