comparison 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
comparison
equal deleted inserted replaced
830:f160166612c2 831:0c3638673464
82 end 82 end
83 83
84 queue[#queue+1] = cached_stanza; 84 queue[#queue+1] = cached_stanza;
85 end 85 end
86 local ok, err = _send(stanza); 86 local ok, err = _send(stanza);
87 if ok and #queue > max_unacked_stanzas and not session.awaiting_ack then 87 if ok and #queue > max_unacked_stanzas and not session.awaiting_ack and attr and not attr.xmlns then
88 session.awaiting_ack = true; 88 session.awaiting_ack = true;
89 return _send(st.stanza("r", sm_attr)); 89 return _send(st.stanza("r", sm_attr));
90 end 90 end
91 return ok, err; 91 return ok, err;
92 end 92 end
222 session.log("debug", "mod_smacks hibernation timeout reached..."); 222 session.log("debug", "mod_smacks hibernation timeout reached...");
223 -- We need to check the current resumption token for this resource 223 -- We need to check the current resumption token for this resource
224 -- matches the smacks session this timer is for in case it changed 224 -- matches the smacks session this timer is for in case it changed
225 -- (for example, the client may have bound a new resource and 225 -- (for example, the client may have bound a new resource and
226 -- started a new smacks session, or not be using smacks) 226 -- started a new smacks session, or not be using smacks)
227 local curr_session = hosts[session.host].sessions[session.username].sessions[session.resource]; 227 local curr_session = full_sessions[session.full_jid];
228 if curr_session.resumption_token == resumption_token 228 if curr_session and curr_session.resumption_token == resumption_token
229 -- Check the hibernate time still matches what we think it is, 229 -- Check the hibernate time still matches what we think it is,
230 -- otherwise the session resumed and re-hibernated. 230 -- otherwise the session resumed and re-hibernated.
231 and session.hibernating == hibernate_time then 231 and session.hibernating == hibernate_time then
232 session.log("debug", "Destroying session for hibernating too long"); 232 session.log("debug", "Destroying session for hibernating too long");
233 session_registry[session.resumption_token] = nil; 233 session_registry[session.resumption_token] = nil;