Software /
code /
prosody
Changeset
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 |
parents | 12111:f8d280215633 |
children | 12113:86e6f0810956 |
files | plugins/mod_smacks.lua |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
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);