chore(schema): don't automaticly add ipv4 address if configured as
`:1883`
This commit is contained in:
parent
03eaa07c02
commit
607f68bab1
|
@ -542,6 +542,8 @@ format_bind(Str) when is_list(Str) ->
|
|||
case emqx_schema:to_ip_port(Str) of
|
||||
{ok, {Ip, Port}} ->
|
||||
format_bind({Ip, Port});
|
||||
{ok, Port} ->
|
||||
format_bind(Port);
|
||||
{error, _} ->
|
||||
format_bind(list_to_integer(Str))
|
||||
end;
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
-type comma_separated_binary() :: [binary()].
|
||||
-type comma_separated_atoms() :: [atom()].
|
||||
-type bar_separated_list() :: list().
|
||||
-type ip_port() :: tuple().
|
||||
-type ip_port() :: tuple() | integer().
|
||||
-type cipher() :: map().
|
||||
|
||||
-typerefl_from_string({duration/0, emqx_schema, to_duration}).
|
||||
|
@ -2169,7 +2169,7 @@ to_bar_separated_list(Str) ->
|
|||
to_ip_port(Str) ->
|
||||
case split_ip_port(Str) of
|
||||
{"", Port} ->
|
||||
{ok, {{0, 0, 0, 0}, list_to_integer(Port)}};
|
||||
{ok, list_to_integer(Port)};
|
||||
{Ip, Port} ->
|
||||
PortVal = list_to_integer(Port),
|
||||
case inet:parse_address(Ip) of
|
||||
|
|
|
@ -169,9 +169,8 @@ t_format_bind(_) ->
|
|||
":1883",
|
||||
lists:flatten(emqx_listeners:format_bind("1883"))
|
||||
),
|
||||
%% due to the emqx_schema:to_ip_port/1, automaticlly add the IPv4 address
|
||||
?assertEqual(
|
||||
"0.0.0.0:1883",
|
||||
":1883",
|
||||
lists:flatten(emqx_listeners:format_bind(":1883"))
|
||||
).
|
||||
|
||||
|
|
|
@ -594,7 +594,7 @@ t_remote(_) ->
|
|||
|
||||
try
|
||||
{ok, ClientPidLocal} = emqtt:connect(ConnPidLocal),
|
||||
{ok, ClientPidRemote} = emqtt:connect(ConnPidRemote),
|
||||
{ok, _ClientPidRemote} = emqtt:connect(ConnPidRemote),
|
||||
|
||||
emqtt:subscribe(ConnPidRemote, {<<"$share/remote_group/", Topic/binary>>, 0}),
|
||||
|
||||
|
|
Loading…
Reference in New Issue