plugins/mod_smacks.lua
changeset 11942 6da703cb4c04
parent 11941 364c3f018e3a
child 11956 b78a341e72e7
equal deleted inserted replaced
11941:364c3f018e3a 11942:6da703cb4c04
   234 		if session.hibernating then
   234 		if session.hibernating then
   235 			session.log("debug", "hibernating since %s, stanza queued", datetime.datetime(session.hibernating));
   235 			session.log("debug", "hibernating since %s, stanza queued", datetime.datetime(session.hibernating));
   236 			module:fire_event("smacks-hibernation-stanza-queued", {origin = session, queue = queue, stanza = cached_stanza});
   236 			module:fire_event("smacks-hibernation-stanza-queued", {origin = session, queue = queue, stanza = cached_stanza});
   237 			return nil;
   237 			return nil;
   238 		end
   238 		end
   239 		request_ack_if_needed(session, false, "outgoing_stanza_filter", stanza);
       
   240 	end
   239 	end
   241 	return stanza;
   240 	return stanza;
   242 end
   241 end
   243 
   242 
   244 local function count_incoming_stanzas(stanza, session)
   243 local function count_incoming_stanzas(stanza, session)
   650 -- Events when it's sensible to request an ack
   649 -- Events when it's sensible to request an ack
   651 -- Could experiment with forcing (ignoring max_unacked) <r>, but when and why?
   650 -- Could experiment with forcing (ignoring max_unacked) <r>, but when and why?
   652 local request_ack_events = {
   651 local request_ack_events = {
   653 	["csi-client-active"] = true;
   652 	["csi-client-active"] = true;
   654 	["csi-flushing"] = false;
   653 	["csi-flushing"] = false;
       
   654 	["c2s-pre-ondrain"] = false;
       
   655 	["s2s-pre-ondrain"] = false;
   655 };
   656 };
   656 
   657 
   657 for event_name, force in pairs(request_ack_events) do
   658 for event_name, force in pairs(request_ack_events) do
   658 	module:log("info", "module:hook(%q, function)");
   659 	module:log("info", "module:hook(%q, function)");
   659 	module:hook(event_name, function(event)
   660 	module:hook(event_name, function(event)