mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 17:59:31 +02:00
ejabberd_listener: Let supervisor terminate child
If a TCP connection was closed before the socket was handed over to a supervised child process, let the supervisor terminate the process rather than killing it directly. This avoids crash log entries generated by the supervisor.
This commit is contained in:
parent
865074603c
commit
5649e35a64
1 changed files with 6 additions and 1 deletions
|
@ -307,7 +307,12 @@ start_connection(Module, Arity, Socket, State, Sup) ->
|
||||||
Module:accept(Pid),
|
Module:accept(Pid),
|
||||||
{ok, Pid};
|
{ok, Pid};
|
||||||
Err ->
|
Err ->
|
||||||
exit(Pid, kill),
|
case Sup of
|
||||||
|
undefined ->
|
||||||
|
exit(Pid, kill);
|
||||||
|
_ ->
|
||||||
|
supervisor:terminate_child(Sup, Pid)
|
||||||
|
end,
|
||||||
Err
|
Err
|
||||||
end;
|
end;
|
||||||
Err ->
|
Err ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue