summaryrefslogtreecommitdiff
path: root/components/dlink_tcp
diff options
context:
space:
mode:
authorUlf Wiger <ulf@feuerlabs.com>2016-01-15 12:12:29 -0800
committerUlf Wiger <ulf@feuerlabs.com>2016-01-15 12:12:29 -0800
commita3c2003b644cb321e389def8034995fd2073a226 (patch)
treeab408d4a7c2b3736db2e98aecf88f33d681fc865 /components/dlink_tcp
parente9b83c71386b9d4d6aa535a43d81bc48457015d7 (diff)
downloadrvi_core-a3c2003b644cb321e389def8034995fd2073a226.tar.gz
rewrite json decoder transition code in rvi_common
Diffstat (limited to 'components/dlink_tcp')
-rw-r--r--components/dlink_tcp/src/connection.erl9
-rw-r--r--components/dlink_tcp/src/dlink_tcp_rpc.erl2
2 files changed, 4 insertions, 7 deletions
diff --git a/components/dlink_tcp/src/connection.erl b/components/dlink_tcp/src/connection.erl
index c6a9531..5444d11 100644
--- a/components/dlink_tcp/src/connection.erl
+++ b/components/dlink_tcp/src/connection.erl
@@ -46,7 +46,6 @@
sock = undefined,
mod = undefined,
func = undefined,
- args = undefined,
packet_mod = ?PACKET_MOD,
packet_st = [],
decode_st = <<>>,
@@ -289,9 +288,9 @@ handle_info({tcp_closed, Sock},
port = Port,
mod = Mod,
func = Fun,
- args = Arg } = State) ->
+ cs = CS } = State) ->
?debug("handle_info(tcp_closed): Address: ~p:~p ", [IP, Port]),
- Mod:Fun(self(), IP, Port, closed, Arg),
+ Mod:Fun(self(), IP, Port, closed, CS),
gen_tcp:close(Sock),
connection_manager:delete_connection_by_pid(self()),
{stop, normal, State};
@@ -302,10 +301,10 @@ handle_info({tcp_error, _Sock},
port = Port,
mod = Mod,
func = Fun,
- args = Arg} = State) ->
+ cs = CS} = State) ->
?debug("handle_info(tcp_error): Address: ~p:~p ", [IP, Port]),
- Mod:Fun(self(), IP, Port, error, Arg),
+ Mod:Fun(self(), IP, Port, error, CS),
connection_manager:delete_connection_by_pid(self()),
{stop, normal, State};
diff --git a/components/dlink_tcp/src/dlink_tcp_rpc.erl b/components/dlink_tcp/src/dlink_tcp_rpc.erl
index afabafe..31184bd 100644
--- a/components/dlink_tcp/src/dlink_tcp_rpc.erl
+++ b/components/dlink_tcp/src/dlink_tcp_rpc.erl
@@ -375,7 +375,6 @@ handle_socket_(FromPid, PeerIP, PeerPort, data, Elems, CompSpec) ->
ProtoMod, Data, CompSpec);
?DLINK_CMD_PING ->
- ?info("dlink_tcp:ping(): Pinged from: ~p:~p", [ PeerIP, PeerPort ]),
ok;
undefined ->
@@ -574,7 +573,6 @@ handle_info({ rvi_ping, Pid, Address, Port, Timeout}, St) ->
%% Check that connection is up
case connection:is_connection_up(Pid) of
true ->
- ?info("dlink_tcp:ping(): Pinging: ~p:~p", [Address, Port]),
connection:send(Pid, [{?DLINK_ARG_CMD, ?DLINK_CMD_PING}]),
erlang:send_after(Timeout, self(),
{ rvi_ping, Pid, Address, Port, Timeout });