mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 09:49:18 +02:00
Compare commits
No commits in common. "3183e2f7337f9fa1f016f99bd3cf5d0619ee161b" and "8b61cf074232994c53c66a09545e814f6174e703" have entirely different histories.
3183e2f733
...
8b61cf0742
2 changed files with 22 additions and 26 deletions
|
@ -139,13 +139,16 @@ init({Port, _, udp} = EndPoint, Module, Opts, SockOpts) ->
|
||||||
{error, _} ->
|
{error, _} ->
|
||||||
ok
|
ok
|
||||||
end;
|
end;
|
||||||
{error, Reason} ->
|
{error, Reason} = Err ->
|
||||||
return_socket_error(Reason, EndPoint, Module)
|
report_socket_error(Reason, EndPoint, Module),
|
||||||
|
proc_lib:init_ack(Err)
|
||||||
end;
|
end;
|
||||||
{{error, Reason}, _} ->
|
{{error, Reason} = Err, _} ->
|
||||||
return_socket_error(Reason, EndPoint, Module);
|
report_socket_error(Reason, EndPoint, Module),
|
||||||
{_, {error, Reason} } ->
|
proc_lib:init_ack(Err);
|
||||||
return_socket_error(Reason, EndPoint, Module)
|
{_, {error, Reason} = Err} ->
|
||||||
|
report_socket_error(Reason, EndPoint, Module),
|
||||||
|
proc_lib:init_ack(Err)
|
||||||
end;
|
end;
|
||||||
init({Port, _, tcp} = EndPoint, Module, Opts, SockOpts) ->
|
init({Port, _, tcp} = EndPoint, Module, Opts, SockOpts) ->
|
||||||
case {listen_tcp(Port, SockOpts),
|
case {listen_tcp(Port, SockOpts),
|
||||||
|
@ -174,13 +177,16 @@ init({Port, _, tcp} = EndPoint, Module, Opts, SockOpts) ->
|
||||||
{error, _} ->
|
{error, _} ->
|
||||||
ok
|
ok
|
||||||
end;
|
end;
|
||||||
{error, Reason} ->
|
{error, Reason} = Err ->
|
||||||
return_socket_error(Reason, EndPoint, Module)
|
report_socket_error(Reason, EndPoint, Module),
|
||||||
|
proc_lib:init_ack(Err)
|
||||||
end;
|
end;
|
||||||
{{error, Reason}, _} ->
|
{{error, Reason}, _} = Err ->
|
||||||
return_socket_error(Reason, EndPoint, Module);
|
report_socket_error(Reason, EndPoint, Module),
|
||||||
{_, {error, Reason}} ->
|
proc_lib:init_ack(Err);
|
||||||
return_socket_error(Reason, EndPoint, Module)
|
{_, {error, Reason}} = Err ->
|
||||||
|
report_socket_error(Reason, EndPoint, Module),
|
||||||
|
proc_lib:init_ack(Err)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec listen_tcp(inet:port_number(), [gen_tcp:option()]) ->
|
-spec listen_tcp(inet:port_number(), [gen_tcp:option()]) ->
|
||||||
|
@ -602,20 +608,10 @@ config_reloaded() ->
|
||||||
end
|
end
|
||||||
end, New).
|
end, New).
|
||||||
|
|
||||||
-spec return_socket_error(inet:posix(), endpoint(), module()) -> no_return().
|
-spec report_socket_error(inet:posix(), endpoint(), module()) -> ok.
|
||||||
return_socket_error(Reason, EndPoint, Module) ->
|
report_socket_error(Reason, EndPoint, Module) ->
|
||||||
?ERROR_MSG("Failed to open socket at ~ts for ~ts: ~ts",
|
?ERROR_MSG("Failed to open socket at ~ts for ~ts: ~ts",
|
||||||
[format_endpoint(EndPoint), Module, format_error(Reason)]),
|
[format_endpoint(EndPoint), Module, format_error(Reason)]).
|
||||||
return_init_error(Reason).
|
|
||||||
|
|
||||||
-ifdef(OTP_BELOW_26).
|
|
||||||
return_init_error(Reason) ->
|
|
||||||
proc_lib:init_ack({error, Reason}).
|
|
||||||
-else.
|
|
||||||
-spec return_init_error(inet:posix()) -> no_return().
|
|
||||||
return_init_error(Reason) ->
|
|
||||||
proc_lib:init_fail({error, Reason}, {exit, normal}).
|
|
||||||
-endif.
|
|
||||||
|
|
||||||
-spec format_error(inet:posix() | atom()) -> string().
|
-spec format_error(inet:posix() | atom()) -> string().
|
||||||
format_error(Reason) ->
|
format_error(Reason) ->
|
||||||
|
|
|
@ -69,7 +69,7 @@ process([], #request{method = 'GET', host = Host, q = Query, raw_path = RawPath1
|
||||||
{<<"default_domain">>, Domain},
|
{<<"default_domain">>, Domain},
|
||||||
{<<"domain_placeholder">>, Domain},
|
{<<"domain_placeholder">>, Domain},
|
||||||
{<<"registration_domain">>, Domain},
|
{<<"registration_domain">>, Domain},
|
||||||
{<<"assets_path">>, <<RawPath/binary, "/">>},
|
{<<"assets_path">>, RawPath},
|
||||||
{<<"view_mode">>, <<"fullscreen">>}
|
{<<"view_mode">>, <<"fullscreen">>}
|
||||||
| ExtraOptions],
|
| ExtraOptions],
|
||||||
Init2 =
|
Init2 =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue