25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Avoid lager crash on external authentication failure

Fixes #2463
This commit is contained in:
Evgeniy Khramtsov 2018-06-08 09:51:26 +03:00
parent 00534d4566
commit 6f481e3ceb
2 changed files with 3 additions and 3 deletions

View File

@ -128,7 +128,7 @@ handle_call({cmd, Cmd, EndTime}, _From, State) ->
{'EXIT', Port, Reason} -> {'EXIT', Port, Reason} ->
handle_info({'EXIT', Port, Reason}, State) handle_info({'EXIT', Port, Reason}, State)
after Timeout -> after Timeout ->
{stop, extauth_program_timeout, State} {stop, normal, State}
end; end;
true -> true ->
{noreply, State} {noreply, State}
@ -148,7 +148,7 @@ handle_info({'EXIT', Port, _Reason}, #state{port = Port,
?ERROR_MSG("External authentication program '~s' has terminated " ?ERROR_MSG("External authentication program '~s' has terminated "
"unexpectedly (pid=~w), restarting via supervisor...", "unexpectedly (pid=~w), restarting via supervisor...",
[State#state.prog, State#state.os_pid]), [State#state.prog, State#state.os_pid]),
{stop, extauth_program_failure, State} {stop, normal, State}
end; end;
handle_info(Info, State) -> handle_info(Info, State) ->
?WARNING_MSG("Unexpected info: ~p", [Info]), ?WARNING_MSG("Unexpected info: ~p", [Info]),

View File

@ -107,4 +107,4 @@ init([Host, Prog, Pool]) ->
worker_spec(Pool, Prog, I) -> worker_spec(Pool, Prog, I) ->
Worker = extauth:worker_name(Pool, I), Worker = extauth:worker_name(Pool, I),
{Worker, {extauth, start_link, [Worker, Prog]}, {Worker, {extauth, start_link, [Worker, Prog]},
transient, 5000, worker, [extauth]}. permanent, 5000, worker, [extauth]}.