diff options
author | Mickaël Rémond <mickael.remond@process-one.net> | 2007-07-25 08:48:55 +0000 |
---|---|---|
committer | Mickaël Rémond <mickael.remond@process-one.net> | 2007-07-25 08:48:55 +0000 |
commit | 637ce31f5ed6f8218028b3f87b235f7c97c1aa67 (patch) | |
tree | 0a08da3a201c18508f971d118c3acda6516067ee /src | |
parent | * doc/guide.tex: Added recommandations on max_stanza options usage. (diff) |
* src/p1_fsm.erl: Use of catch can break tail recursion.
SVN Revision: 823
Diffstat (limited to 'src')
-rw-r--r-- | src/p1_fsm.erl | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/p1_fsm.erl b/src/p1_fsm.erl index 3fb5cdb1a..25ef5bc5e 100644 --- a/src/p1_fsm.erl +++ b/src/p1_fsm.erl @@ -360,29 +360,29 @@ 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 {'EXIT', Parent, priority_shutdown} -> {'EXIT', Parent, priority_shutdown} - after 0 -> - receive - Input -> - Input - after Time -> - {'$gen_event', timeout} - end - end, + after 0 -> + receive + Input -> + Input + after Time -> + {'$gen_event', timeout} + end + end, case Msg of {system, From, Req} -> sys:handle_system_msg(Req, From, Parent, ?MODULE, Debug, |