comparison mod_adhoc_cmd_admin/mod_adhoc_cmd_admin.lua @ 48:7fbaf590dc12

mod_adhoc_cmd_admin: Fix session leak
author Florian Zeitz <florob@babelmonkeys.de>
date Sat, 17 Oct 2009 01:36:25 +0200
parents 00f96207693a
children 59f490390528
comparison
equal deleted inserted replaced
47:99ff520519fe 48:7fbaf590dc12
128 origin.send(st.reply(stanza):add_child(item:cmdtag("completed", stanza.tags[1].attr.sessionid) 128 origin.send(st.reply(stanza):add_child(item:cmdtag("completed", stanza.tags[1].attr.sessionid)
129 :tag("x", {xmlns="jabber:x:data", type="result"}) 129 :tag("x", {xmlns="jabber:x:data", type="result"})
130 :tag("field", {type="hidden", var="FORM_TYPE"}) 130 :tag("field", {type="hidden", var="FORM_TYPE"})
131 :tag("value"):text("http://jabber.org/protocol/admin"):up():up() 131 :tag("value"):text("http://jabber.org/protocol/admin"):up():up()
132 :add_child(field))); 132 :add_child(field)));
133 sessions[stanza.tags[1].attr.sessionid] = nil;
134 return true;
133 else 135 else
134 local sessionid=uuid.generate(); 136 local sessionid=uuid.generate();
135 sessions[sessionid] = "executing"; 137 sessions[sessionid] = "executing";
136 origin.send(st.reply(stanza):add_child(item:cmdtag("executing", sessionid):add_child(get_online_users_layout:form()))); 138 origin.send(st.reply(stanza):add_child(item:cmdtag("executing", sessionid):add_child(get_online_users_layout:form())));
137 end 139 end