+2007-12-22 Badlop <badlop@process-one.net>
+
+ * src/mod_caps.erl: Bugfix in timeout checking. Check for timeout
+ when an error response is received, and also before querying
+
2007-12-21 Badlop <badlop@process-one.net>
* src/ejabberd_ctl.erl: Added new command: mnesia (thanks to
{ok, Features} ->
{reply, Features, State};
wait ->
+ gen_server:cast(self(), visit_feature_queries),
Timeout = timestamp() + 10,
FeatureQueries = State#state.feature_queries,
NewFeatureQueries = [{From, Caps, Timeout} | FeatureQueries],
error ->
?ERROR_MSG("ID '~s' matches no query", [ID])
end;
+ {error, _} ->
+ gen_server:cast(self(), visit_feature_queries),
+ ?ERROR_MSG("Error IQ reponse IQ from ~s: ~p", [jlib:jid_to_string(From), SubEls]);
{result, _} ->
?ERROR_MSG("Invalid IQ contents from ~s: ~p", [jlib:jid_to_string(From), SubEls]);
_ ->
NewFeatureQueries =
lists:foldl(fun({From, Caps, Timeout}, Acc) ->
case maybe_get_features(Caps) of
- wait when Timeout < Timestamp -> [{From, Caps, Timeout} | Acc];
+ wait when Timeout > Timestamp -> [{From, Caps, Timeout} | Acc];
wait -> Acc;
{ok, Features} ->
gen_server:reply(From, Features),