From c24af4ca6328628e4d9c46da8a4a4e4ff830bdeb Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Thu, 28 Jan 2010 13:46:44 +0000 Subject: [PATCH] new ejabberd_c2s option support: max_fsm_queue SVN Revision: 2940 --- src/ejabberd_c2s.erl | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index bd2353cc6..bad7517f7 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -111,7 +111,7 @@ %% Module start with or without supervisor: -ifdef(NO_TRANSIENT_SUPERVISORS). -define(SUPERVISOR_START, ?GEN_FSM:start(ejabberd_c2s, [SockData, Opts], - fsm_limit_opts() ++ ?FSMOPTS)). + fsm_limit_opts(Opts) ++ ?FSMOPTS)). -else. -define(SUPERVISOR_START, supervisor:start_child(ejabberd_c2s_sup, [SockData, Opts])). @@ -158,7 +158,7 @@ start(SockData, Opts) -> start_link(SockData, Opts) -> ?GEN_FSM:start_link(ejabberd_c2s, [SockData, Opts], - fsm_limit_opts() ++ ?FSMOPTS). + fsm_limit_opts(Opts) ++ ?FSMOPTS). socket_type() -> xml_stream. @@ -2083,10 +2083,15 @@ check_from(El, FromJID) -> end end. -fsm_limit_opts() -> - case ejabberd_config:get_local_option(max_fsm_queue) of - N when is_integer(N) -> +fsm_limit_opts(Opts) -> + case lists:keysearch(max_fsm_queue, 1, Opts) of + {value, {_, N}} when is_integer(N) -> [{max_queue, N}]; _ -> - [] + case ejabberd_config:get_local_option(max_fsm_queue) of + N when is_integer(N) -> + [{max_queue, N}]; + _ -> + [] + end end.