24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-02 21:17:12 +02:00

Compare commits

..

No commits in common. "426e33d3a67302518adb9b778dca448ff71166c9" and "dbf0fb8e8610aaff79c48675dd6f600303263db5" have entirely different histories.

4 changed files with 26 additions and 43 deletions

View File

@ -79,9 +79,6 @@ fi
if [ -n "$INET_DIST_INTERFACE" ] ; then
INET_DIST_INTERFACE2=$("$ERL" $ERLANG_OPTS -noshell -eval 'case inet:parse_address("'$INET_DIST_INTERFACE'") of {ok,IP} -> io:format("~p",[IP]); _ -> ok end.' -s erlang halt)
if [ -n "$INET_DIST_INTERFACE2" ] ; then
if [ "$(echo "$INET_DIST_INTERFACE2" | grep -o "," | wc -l)" -eq 7 ] ; then
INET_DIST_INTERFACE2="$INET_DIST_INTERFACE2 -proto_dist inet6_tcp"
fi
ERLANG_OPTS="$ERLANG_OPTS -kernel inet_dist_use_interface $INET_DIST_INTERFACE2"
fi
fi

View File

@ -78,9 +78,6 @@ fi
if [ -n "$INET_DIST_INTERFACE" ] ; then
INET_DIST_INTERFACE2=$("$ERL" $ERLANG_OPTS -noshell -eval 'case inet:parse_address("'$INET_DIST_INTERFACE'") of {ok,IP} -> io:format("~p",[IP]); _ -> ok end.' -s erlang halt)
if [ -n "$INET_DIST_INTERFACE2" ] ; then
if [ "$(echo "$INET_DIST_INTERFACE2" | grep -o "," | wc -l)" -eq 7 ] ; then
INET_DIST_INTERFACE2="$INET_DIST_INTERFACE2 -proto_dist inet6_tcp"
fi
ERLANG_OPTS="$ERLANG_OPTS -kernel inet_dist_use_interface $INET_DIST_INTERFACE2"
fi
fi

View File

@ -37,36 +37,30 @@ start(Host) ->
case is_started(Host) of
true -> ok;
false ->
case lists:member(Host, ejabberd_option:hosts()) of
false ->
?WARNING_MSG("Rejecting start of sql worker for unknown host: ~ts", [Host]),
{error, invalid_host};
true ->
App = case ejabberd_option:sql_type(Host) of
mysql -> p1_mysql;
pgsql -> p1_pgsql;
sqlite -> sqlite3;
_ -> odbc
end,
ejabberd:start_app(App),
Spec = #{id => gen_mod:get_module_proc(Host, ?MODULE),
start => {ejabberd_sql_sup, start_link, [Host]},
restart => transient,
shutdown => infinity,
type => supervisor,
modules => [?MODULE]},
case supervisor:start_child(ejabberd_db_sup, Spec) of
{ok, _} ->
ejabberd_sql_schema:start(Host),
ok;
{error, {already_started, Pid}} ->
%% Wait for the supervisor to fully start
_ = supervisor:count_children(Pid),
ok;
{error, Why} = Err ->
?ERROR_MSG("Failed to start ~ts: ~p", [?MODULE, Why]),
Err
end
App = case ejabberd_option:sql_type(Host) of
mysql -> p1_mysql;
pgsql -> p1_pgsql;
sqlite -> sqlite3;
_ -> odbc
end,
ejabberd:start_app(App),
Spec = #{id => gen_mod:get_module_proc(Host, ?MODULE),
start => {ejabberd_sql_sup, start_link, [Host]},
restart => transient,
shutdown => infinity,
type => supervisor,
modules => [?MODULE]},
case supervisor:start_child(ejabberd_db_sup, Spec) of
{ok, _} ->
ejabberd_sql_schema:start(Host),
ok;
{error, {already_started, Pid}} ->
%% Wait for the supervisor to fully start
_ = supervisor:count_children(Pid),
ok;
{error, Why} = Err ->
?ERROR_MSG("Failed to start ~ts: ~p", [?MODULE, Why]),
Err
end
end.

View File

@ -322,13 +322,8 @@ convert_roster_item(LUser, LServer, JIDstring, LuaList) ->
[R#roster{name = Name}];
({<<"persist">>, false}, _) ->
[];
({<<"approved">>, _}, [R]) ->
[R];
(A, [R]) ->
io:format("Warning: roster of user ~ts@~ts includes unknown "
"attribute:~n ~p~nand that one is discarded.~n",
[LUser, LServer, A]),
[R]
(_, []) ->
[]
end, [InitR], LuaList)
catch _:{bad_jid, _} ->
[]