mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
Don't let a receiver to crash if a controller is unavailable
Fixes #1796
This commit is contained in:
parent
a095477b4c
commit
5bb7a0b0db
@ -67,7 +67,10 @@
|
||||
start(SockData, Opts) ->
|
||||
case proplists:get_value(supervisor, Opts, true) of
|
||||
true ->
|
||||
supervisor:start_child(ejabberd_c2s_sup, [SockData, Opts]);
|
||||
case supervisor:start_child(ejabberd_c2s_sup, [SockData, Opts]) of
|
||||
{ok, undefined} -> ignore;
|
||||
Res -> Res
|
||||
end;
|
||||
_ ->
|
||||
xmpp_stream_in:start(?MODULE, [SockData, Opts],
|
||||
ejabberd_config:fsm_limit_opts(Opts))
|
||||
|
@ -57,7 +57,10 @@
|
||||
start(SockData, Opts) ->
|
||||
case proplists:get_value(supervisor, Opts, true) of
|
||||
true ->
|
||||
supervisor:start_child(ejabberd_s2s_in_sup, [SockData, Opts]);
|
||||
case supervisor:start_child(ejabberd_s2s_in_sup, [SockData, Opts]) of
|
||||
{ok, undefined} -> ignore;
|
||||
Res -> Res
|
||||
end;
|
||||
_ ->
|
||||
xmpp_stream_in:start(?MODULE, [SockData, Opts],
|
||||
ejabberd_config:fsm_limit_opts(Opts))
|
||||
|
@ -54,10 +54,13 @@
|
||||
%%%===================================================================
|
||||
start(From, To, Opts) ->
|
||||
case proplists:get_value(supervisor, Opts, true) of
|
||||
true ->
|
||||
supervisor:start_child(ejabberd_s2s_out_sup,
|
||||
[From, To, Opts]);
|
||||
_ ->
|
||||
true ->
|
||||
case supervisor:start_child(ejabberd_s2s_out_sup,
|
||||
[From, To, Opts]) of
|
||||
{ok, undefined} -> ignore;
|
||||
Res -> Res
|
||||
end;
|
||||
_ ->
|
||||
xmpp_stream_out:start(?MODULE, [ejabberd_socket, From, To, Opts],
|
||||
ejabberd_config:fsm_limit_opts([]))
|
||||
end.
|
||||
|
@ -87,7 +87,7 @@
|
||||
%% API
|
||||
%%====================================================================
|
||||
-spec start(atom(), sockmod(), socket(), [proplists:property()])
|
||||
-> {ok, pid() | independent} | {error, inet:posix() | any()}.
|
||||
-> {ok, pid() | independent} | {error, inet:posix() | any()} | ignore.
|
||||
start(Module, SockMod, Socket, Opts) ->
|
||||
case Module:socket_type() of
|
||||
independent -> {ok, independent};
|
||||
|
Loading…
Reference in New Issue
Block a user