Comparison

plugins/mod_smacks.lua @ 12796:d7853bbc88ea 0.12

mod_smacks: Disable resumption behavior on s2s Since resumption is not supported on s2s currently, there is no point in allocating resumption tokens. The code that removes entries from session_registry is only invoked for c2s sessions, thus enabling resumable smacks on s2s adds an entry that never goes away.
author Kim Alvefur <zash@zash.se>
date Sun, 13 Nov 2022 18:16:59 +0100
parent 12549:3729a6bdb562
child 12850:101c758428aa
comparison
equal deleted inserted replaced
12792:997f3ca90628 12796:d7853bbc88ea
306 wrap_session(session, false); 306 wrap_session(session, false);
307 307
308 local resume_max; 308 local resume_max;
309 local resume_token; 309 local resume_token;
310 local resume = stanza.attr.resume; 310 local resume = stanza.attr.resume;
311 if resume == "true" or resume == "1" then 311 if (resume == "true" or resume == "1") and session.username then
312 -- resumption on s2s is not currently supported
312 resume_token = new_id(); 313 resume_token = new_id();
313 session_registry[jid.join(session.username, session.host, resume_token)] = session; 314 session_registry[jid.join(session.username, session.host, resume_token)] = session;
314 session.resumption_token = resume_token; 315 session.resumption_token = resume_token;
315 resume_max = tostring(resume_timeout); 316 resume_max = tostring(resume_timeout);
316 end 317 end