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

* src/p1_fsm.erl: Use of catch can break tail recursion.

SVN Revision: 823
This commit is contained in:
Mickaël Rémond 2007-07-25 08:48:55 +00:00
parent be494565a9
commit 637ce31f5e

View File

@ -360,16 +360,16 @@ init_it(Starter, Parent, Name, Mod, Args, Options) ->
%% First we test if we have reach a defined limit ...
loop(Parent, Name, StateName, StateData, Mod, Time, Debug, Limits) ->
try
message_queue_len(Limits),
message_queue_len(Limits)
%% TODO: We can add more limit checking here...
process_message(Parent, Name, StateName, StateData,
Mod, Time, Debug, Limits)
catch
{process_limit, Limit} ->
Reason = {process_limit, Limit},
Msg = {'EXIT', Parent, {error, {process_limit, Limit}}},
terminate(Reason, Name, Msg, Mod, StateName, StateData, Debug)
end.
end,
process_message(Parent, Name, StateName, StateData,
Mod, Time, Debug, Limits).
%% ... then we can process a new message:
process_message(Parent, Name, StateName, StateData, Mod, Time, Debug, Limits) ->
Msg = receive