Merge pull request #3039 from emqx/bump-version

Upgrade deps to ekka v0.7.0 and esockd v5.6.0
This commit is contained in:
tigercl 2019-11-18 10:58:42 +08:00 committed by GitHub
commit c2e973d4f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 12 deletions

View File

@ -1,11 +1,11 @@
{minimum_otp_vsn, "21.0"}.
{deps,
[{jsx, "2.9.0"}, % hex
{cowboy, "2.6.1"}, % hex
{gproc, "0.8.0"}, % hex
{esockd, {git, "https://github.com/emqx/esockd", {tag, "v5.5.2"}}},
{ekka, {git, "https://github.com/emqx/ekka", {tag, "v0.6.2"}}},
[{jsx, "2.10.0"},
{cowboy, "2.7.0"},
{gproc, "0.8.0"},
{esockd, {git, "https://github.com/emqx/esockd", {tag, "5.6.0"}}},
{ekka, {git, "https://github.com/emqx/ekka", {tag, "0.7.0"}}},
{gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.4.1"}}},
{cuttlefish, {git, "https://github.com/emqx/cuttlefish", {tag, "v3.0.0"}}}
]}.

View File

@ -101,7 +101,8 @@
-spec(start_link(esockd:transport(), esockd:socket(), proplists:proplist())
-> {ok, pid()}).
start_link(Transport, Socket, Options) ->
CPid = proc_lib:spawn_link(?MODULE, init, [self(), Transport, Socket, Options]),
Args = [self(), Transport, Socket, Options],
CPid = proc_lib:spawn_link(?MODULE, init, Args),
{ok, CPid}.
%%--------------------------------------------------------------------
@ -196,7 +197,7 @@ do_init(Parent, Transport, Socket, Options) ->
IdleTimeout = emqx_zone:idle_timeout(Zone),
IdleTimer = start_timer(IdleTimeout, idle_timeout),
emqx_misc:tune_heap_size(emqx_zone:oom_policy(Zone)),
emqx_logger:set_metadata_peername(esockd_net:format(Peername)),
emqx_logger:set_metadata_peername(esockd:format(Peername)),
State = #state{transport = Transport,
socket = Socket,
peername = Peername,

View File

@ -123,7 +123,7 @@ handle_cast({detected, #flapping{clientid = ClientId,
case now_diff(StartedAt) < Duration of
true -> %% Flapping happened:(
?LOG(error, "Flapping detected: ~s(~s) disconnected ~w times in ~wms",
[ClientId, esockd_net:ntoa(PeerHost), DetectCnt, Duration]),
[ClientId, inet:ntoa(PeerHost), DetectCnt, Duration]),
Now = erlang:system_time(millisecond),
Banned = #banned{who = {clientid, ClientId},
by = <<"flapping detector">>,
@ -134,7 +134,7 @@ handle_cast({detected, #flapping{clientid = ClientId,
emqx_banned:create(Banned);
false ->
?LOG(warning, "~s(~s) disconnected ~w times in ~wms",
[ClientId, esockd_net:ntoa(PeerHost), DetectCnt, Interval])
[ClientId, inet:ntoa(PeerHost), DetectCnt, Interval])
end,
{noreply, State};

View File

@ -176,5 +176,5 @@ format(Port) when is_integer(Port) ->
format({Addr, Port}) when is_list(Addr) ->
io_lib:format("~s:~w", [Addr, Port]);
format({Addr, Port}) when is_tuple(Addr) ->
io_lib:format("~s:~w", [esockd_net:ntoab(Addr), Port]).
io_lib:format("~s:~w", [inet:ntoab(Addr), Port]).

View File

@ -112,5 +112,5 @@ reason({Error, _}) when is_atom(Error) -> Error;
reason(_) -> internal_error.
-compile({inline, [ntoa/1]}).
ntoa(IpAddr) -> iolist_to_binary(esockd_net:ntoa(IpAddr)).
ntoa(IpAddr) -> iolist_to_binary(inet:ntoa(IpAddr)).

View File

@ -218,7 +218,7 @@ websocket_init([Req, Opts]) ->
IdleTimeout = emqx_zone:idle_timeout(Zone),
IdleTimer = start_timer(IdleTimeout, idle_timeout),
emqx_misc:tune_heap_size(emqx_zone:oom_policy(Zone)),
emqx_logger:set_metadata_peername(esockd_net:format(Peername)),
emqx_logger:set_metadata_peername(esockd:format(Peername)),
{ok, #state{peername = Peername,
sockname = Sockname,
sockstate = running,