Replace esockd_net with inet
This commit is contained in:
parent
6288cd1345
commit
c9963b1df5
|
@ -123,7 +123,7 @@ handle_cast({detected, #flapping{clientid = ClientId,
|
||||||
case now_diff(StartedAt) < Duration of
|
case now_diff(StartedAt) < Duration of
|
||||||
true -> %% Flapping happened:(
|
true -> %% Flapping happened:(
|
||||||
?LOG(error, "Flapping detected: ~s(~s) disconnected ~w times in ~wms",
|
?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),
|
Now = erlang:system_time(millisecond),
|
||||||
Banned = #banned{who = {clientid, ClientId},
|
Banned = #banned{who = {clientid, ClientId},
|
||||||
by = <<"flapping detector">>,
|
by = <<"flapping detector">>,
|
||||||
|
@ -134,7 +134,7 @@ handle_cast({detected, #flapping{clientid = ClientId,
|
||||||
emqx_banned:create(Banned);
|
emqx_banned:create(Banned);
|
||||||
false ->
|
false ->
|
||||||
?LOG(warning, "~s(~s) disconnected ~w times in ~wms",
|
?LOG(warning, "~s(~s) disconnected ~w times in ~wms",
|
||||||
[ClientId, esockd_net:ntoa(PeerHost), DetectCnt, Interval])
|
[ClientId, inet:ntoa(PeerHost), DetectCnt, Interval])
|
||||||
end,
|
end,
|
||||||
{noreply, State};
|
{noreply, State};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue