comparison mod_smacks/mod_smacks.lua @ 925:720b8268778e

mod_smacks: Don't allow steam resumption onto a stream after resource binding
author Kim Alvefur <zash@zash.se>
date Sat, 09 Mar 2013 20:49:30 +0100
parents abf0f12fe75c
children fabff75bfc3f
comparison
equal deleted inserted replaced
924:0a78ac54bd03 925:720b8268778e
247 247
248 end 248 end
249 end); 249 end);
250 250
251 module:hook_stanza(xmlns_sm, "resume", function (session, stanza) 251 module:hook_stanza(xmlns_sm, "resume", function (session, stanza)
252 if session.full_jid then
253 session.log("debug", "Tried to resume after resource binding");
254 session.send(st.stanza("failed", sm_attr)
255 :tag("unexpected-request", { xmlns = xmlns_errors })
256 );
257 return true;
258 end
259
252 local id = stanza.attr.previd; 260 local id = stanza.attr.previd;
253 local original_session = session_registry[id]; 261 local original_session = session_registry[id];
254 if not original_session then 262 if not original_session then
255 session.log("debug", "Tried to resume non-existent session with id %s", id); 263 session.log("debug", "Tried to resume non-existent session with id %s", id);
256 session.send(st.stanza("failed", sm_attr) 264 session.send(st.stanza("failed", sm_attr)