%%% ejabberd_socket 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_c2s_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],
%%% 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],
%%% API
%%%===================================================================
start(From, To, Opts) ->
- xmpp_stream_out:start(?MODULE, [ejabberd_socket, From, To, Opts],
- ejabberd_config:fsm_limit_opts([])).
+ case proplists:get_value(supervisor, Opts, true) of
+ true ->
+ supervisor:start_child(ejabberd_s2s_out_sup,
+ [ejabberd_socket, From, To, Opts]);
+ _ ->
+ xmpp_stream_out:start(?MODULE, [ejabberd_socket, From, To, Opts],
+ ejabberd_config:fsm_limit_opts([]))
+ end.
start_link(From, To, Opts) ->
xmpp_stream_out:start_link(?MODULE, [ejabberd_socket, From, To, Opts],