diff options
author | Peter Andersson <[email protected]> | 2015-03-26 02:10:49 +0100 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2015-03-26 02:10:49 +0100 |
commit | 8eb65d33f0be00b06c3b8e44b5a2a830a106b831 (patch) | |
tree | 3dea9423a5cedead8162557569d86424b11c4521 /lib/common_test/src/ct_telnet_client.erl | |
parent | f5c57ee1130daff8e7fb8bf9ad4f057a019f59f6 (diff) | |
parent | d28310bd395aa4465c89aa3175d59a1886294c78 (diff) | |
download | otp-8eb65d33f0be00b06c3b8e44b5a2a830a106b831.tar.gz otp-8eb65d33f0be00b06c3b8e44b5a2a830a106b831.tar.bz2 otp-8eb65d33f0be00b06c3b8e44b5a2a830a106b831.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/common_test/src/ct_telnet_client.erl')
-rw-r--r-- | lib/common_test/src/ct_telnet_client.erl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/common_test/src/ct_telnet_client.erl b/lib/common_test/src/ct_telnet_client.erl index f39863824c..b0734d8d65 100644 --- a/lib/common_test/src/ct_telnet_client.erl +++ b/lib/common_test/src/ct_telnet_client.erl @@ -32,7 +32,7 @@ -module(ct_telnet_client). -%% -define(debug, true). +%%-define(debug, true). -export([open/2, open/3, open/4, open/5, close/1]). -export([send_data/2, send_data/3, get_data/1]). @@ -111,7 +111,6 @@ get_data(Pid) -> {ok,Data} end. - %%%----------------------------------------------------------------- %%% Internal functions init(Parent, Server, Port, Timeout, KeepAlive, ConnName) -> @@ -146,7 +145,7 @@ loop(State, Sock, Acc) -> ok end; {tcp,_,Msg0} -> - dbg("tcp msg: ~tp~n",[Msg0]), + dbg("rcv tcp msg: ~tp~n",[Msg0]), Msg = check_msg(Sock,Msg0,[]), loop(State, Sock, [Msg | Acc]); {send_data,Data} -> @@ -180,6 +179,7 @@ loop(State, Sock, Acc) -> NewState = case State of #state{keep_alive = true, get_data = 0} -> + dbg("sending NOP\n",[]), if Acc == [] -> send([?IAC,?NOP], Sock, State#state.conn_name); true -> ok @@ -225,15 +225,17 @@ loop(State, Sock, Acc) -> gen_tcp:close(Sock), Pid ! closed after wait(State#state.keep_alive,?IDLE_TIMEOUT) -> + dbg("idle timeout\n",[]), Data = lists:reverse(lists:append(Acc)), case Data of [] -> + dbg("sending NOP\n",[]), send([?IAC,?NOP], Sock, State#state.conn_name), loop(State, Sock, Acc); _ when State#state.log_pos == length(Data)+1 -> loop(State, Sock, Acc); _ -> - dbg("Idle timeout, printing ~tp\n",[Data]), + dbg("idle timeout, printing ~tp\n",[Data]), Len = length(Data), ct_telnet:log(State#state.conn_name, general_io, "~ts", |