summaryrefslogtreecommitdiff
path: root/src/ejabberd_s2s_in.erl
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-01-11 10:56:04 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-01-11 10:56:04 +0300
commit5cfe57ece56d8b4436f3e862723b560711352508 (patch)
tree69b5ea05392d3008593418874246fb59a6bf4df8 /src/ejabberd_s2s_in.erl
parentDon't forget to advertise disco features (diff)
Add 'supervisor' listening option
If set to 'true' (this is the default), new processes spawned by ejabberd_listener will be attached to the corresponding supervisor. No such processes will be attached to a supervisor otherwise. Setting this to 'false' will improve performance of high loaded systems where new C2S/S2S processes are spawned very rapidly.
Diffstat (limited to 'src/ejabberd_s2s_in.erl')
-rw-r--r--src/ejabberd_s2s_in.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl
index cca8438c..484d0a55 100644
--- a/src/ejabberd_s2s_in.erl
+++ b/src/ejabberd_s2s_in.erl
@@ -55,8 +55,13 @@
%%% API
%%%===================================================================
start(SockData, Opts) ->
- xmpp_stream_in:start(?MODULE, [SockData, Opts],
- ejabberd_config:fsm_limit_opts(Opts)).
+ case proplists:get_value(supervisor, Opts, true) of
+ true ->
+ supervisor:start_child(ejabberd_s2s_in_sup, [SockData, Opts]);
+ _ ->
+ xmpp_stream_in:start(?MODULE, [SockData, Opts],
+ ejabberd_config:fsm_limit_opts(Opts))
+ end.
start_link(SockData, Opts) ->
xmpp_stream_in:start_link(?MODULE, [SockData, Opts],