diff mod_smacks/mod_smacks.lua @ 831:0c3638673464

Merge upstream with my local LDAP work
author Rob Hoelz <rob@hoelz.ro>
date Tue, 18 Sep 2012 00:31:42 +0200
parents 0095b74a3685
children e089160c424b
line wrap: on
line diff
--- a/mod_smacks/mod_smacks.lua	Tue Sep 18 00:29:28 2012 +0200
+++ b/mod_smacks/mod_smacks.lua	Tue Sep 18 00:31:42 2012 +0200
@@ -84,7 +84,7 @@
 			queue[#queue+1] = cached_stanza;
 		end
 		local ok, err = _send(stanza);
-		if ok and #queue > max_unacked_stanzas and not session.awaiting_ack then
+		if ok and #queue > max_unacked_stanzas and not session.awaiting_ack and attr and not attr.xmlns then
 			session.awaiting_ack = true;
 			return _send(st.stanza("r", sm_attr));
 		end
@@ -224,8 +224,8 @@
 				-- matches the smacks session this timer is for in case it changed
 				-- (for example, the client may have bound a new resource and
 				-- started a new smacks session, or not be using smacks)
-				local curr_session = hosts[session.host].sessions[session.username].sessions[session.resource];
-				if curr_session.resumption_token == resumption_token
+				local curr_session = full_sessions[session.full_jid];
+				if curr_session and curr_session.resumption_token == resumption_token
 				-- Check the hibernate time still matches what we think it is,
 				-- otherwise the session resumed and re-hibernated.
 				and session.hibernating == hibernate_time then