24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-16 22:05:29 +02:00

new ejabberd_c2s option support: max_fsm_queue

SVN Revision: 2939
This commit is contained in:
Evgeniy Khramtsov 2010-01-28 13:44:49 +00:00
parent 933d4a69b8
commit 0a3cfeeed9

View File

@ -107,7 +107,7 @@
%% Module start with or without supervisor: %% Module start with or without supervisor:
-ifdef(NO_TRANSIENT_SUPERVISORS). -ifdef(NO_TRANSIENT_SUPERVISORS).
-define(SUPERVISOR_START, ?GEN_FSM:start(ejabberd_c2s, [SockData, Opts], -define(SUPERVISOR_START, ?GEN_FSM:start(ejabberd_c2s, [SockData, Opts],
fsm_limit_opts() ++ ?FSMOPTS)). fsm_limit_opts(Opts) ++ ?FSMOPTS)).
-else. -else.
-define(SUPERVISOR_START, supervisor:start_child(ejabberd_c2s_sup, -define(SUPERVISOR_START, supervisor:start_child(ejabberd_c2s_sup,
[SockData, Opts])). [SockData, Opts])).
@ -143,7 +143,7 @@ start(SockData, Opts) ->
start_link(SockData, Opts) -> start_link(SockData, Opts) ->
?GEN_FSM:start_link(ejabberd_c2s, [SockData, Opts], ?GEN_FSM:start_link(ejabberd_c2s, [SockData, Opts],
fsm_limit_opts() ++ ?FSMOPTS). fsm_limit_opts(Opts) ++ ?FSMOPTS).
socket_type() -> socket_type() ->
xml_stream. xml_stream.
@ -2156,12 +2156,17 @@ check_from(El, FromJID) ->
end end
end. end.
fsm_limit_opts() -> fsm_limit_opts(Opts) ->
case ejabberd_config:get_local_option(max_fsm_queue) of case lists:keysearch(max_fsm_queue, 1, Opts) of
N when is_integer(N) -> {value, {_, N}} when is_integer(N) ->
[{max_queue, N}]; [{max_queue, N}];
_ -> _ ->
[] case ejabberd_config:get_local_option(max_fsm_queue) of
N when is_integer(N) ->
[{max_queue, N}];
_ ->
[]
end
end. end.
%%%---------------------------------------------------------------------- %%%----------------------------------------------------------------------