mod_cache_c2s_caps: Unset the caps_cache also on errors due to the result validation.
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Tue, 22 Jan 2019 15:39:35 +0100
changeset 3460 b85622b577ad
parent 3459 1ef702d30b6b
child 3461 058844edcaaf
mod_cache_c2s_caps: Unset the caps_cache also on errors due to the result validation.
mod_cache_c2s_caps/mod_cache_c2s_caps.lua
--- a/mod_cache_c2s_caps/mod_cache_c2s_caps.lua	Tue Jan 22 15:38:52 2019 +0100
+++ b/mod_cache_c2s_caps/mod_cache_c2s_caps.lua	Tue Jan 22 15:39:35 2019 +0100
@@ -14,6 +14,7 @@
 	local query = stanza:get_child("query", "http://jabber.org/protocol/disco#info");
 	if not query then
 		origin.log("debug", "Wrong iq payload in disco#info result: %s", stanza);
+		origin.caps_cache = nil;
 		return;
 	end
 
@@ -29,6 +30,7 @@
 
 	if node_string ~= node_query then
 		origin.log("debug", "Wrong node for our disco#info query, expected %s, received %s", node_string, node_query);
+		origin.caps_cache = nil;
 		return;
 	end
 
@@ -36,6 +38,7 @@
 	local hash = calculate_hash(query)
 	if ver ~= hash then
 		origin.log("debug", "Wrong hash for disco#info: %s ~= %s", ver, hash);
+		origin.caps_cache = nil;
 		return;
 	end