Software /
code /
prosody
Diff
plugins/mod_smacks.lua @ 12112:08a949e63541
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.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 22 Dec 2021 18:47:45 +0100 |
parent | 12081:6cc3135138d7 |
child | 12114:e32f90c81519 |
line wrap: on
line diff
--- 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);