25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Cache negative response (EJAB-474)

SVN Revision: 1294
This commit is contained in:
Christophe Romain 2008-04-14 12:02:18 +00:00
parent 7c64509c46
commit d46b7d5908
2 changed files with 19 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2008-04-14 Christophe Romain <christophe.romain@process-one.net>
* src/mod_caps.erl: Cache negative response (EJAB-474)
2008-04-12 Badlop <badlop@process-one.net>
* src/web/ejabberd_web_admin.erl: Include Last-Modified HTTP

View File

@ -250,8 +250,21 @@ handle_cast({disco_response, From, _To,
?ERROR_MSG("ID '~s' matches no query", [ID])
end;
{error, _} ->
gen_server:cast(self(), visit_feature_queries),
?DEBUG("Error IQ reponse from ~s:~n~p", [jlib:jid_to_string(From), SubEls]);
%% XXX: if we get error, we cache empty feature not to probe the client continuously
case ?DICT:find(ID, Requests) of
{ok, {Node, SubNode}} ->
Features = [],
mnesia:transaction(
fun() ->
mnesia:write(#caps_features{node_pair = {Node, SubNode},
features = Features})
end),
gen_server:cast(self(), visit_feature_queries);
error ->
?ERROR_MSG("ID '~s' matches no query", [ID])
end;
%gen_server:cast(self(), visit_feature_queries),
%?DEBUG("Error IQ reponse from ~s:~n~p", [jlib:jid_to_string(From), SubEls]);
{result, _} ->
?DEBUG("Invalid IQ contents from ~s:~n~p", [jlib:jid_to_string(From), SubEls]);
_ ->