25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-02 16:37:52 +01:00

Cache negative response (EJAB-474)

SVN Revision: 1293
This commit is contained in:
Christophe Romain 2008-04-14 12:00:37 +00:00
parent bb5e7353a4
commit bd9d2cb97c
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-11 Alexey Shchepin <alexey@process-one.net>
* src/tls/tls_drv.c: Fixed gcc signedness warnings (EJAB-447)

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]);
_ ->