aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2016-11-14 10:18:02 +0100
committerHans Nilsson <[email protected]>2016-11-14 13:54:21 +0100
commit7acfeb55655ed2a2f1ec2ec1ee4dbfc112fc4c54 (patch)
tree14ebd4749d188af610c33f13140bf99f5b520d81
parent9fa62a9774d1c9145fbc807bdf052573dab40ecb (diff)
downloadotp-7acfeb55655ed2a2f1ec2ec1ee4dbfc112fc4c54.tar.gz
otp-7acfeb55655ed2a2f1ec2ec1ee4dbfc112fc4c54.tar.bz2
otp-7acfeb55655ed2a2f1ec2ec1ee4dbfc112fc4c54.zip
ssh: interrupted_send receive loop reports missing number of bytes
-rw-r--r--lib/ssh/test/ssh_connection_SUITE.erl20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/ssh/test/ssh_connection_SUITE.erl b/lib/ssh/test/ssh_connection_SUITE.erl
index e898d55b6f..fc7ea81caf 100644
--- a/lib/ssh/test/ssh_connection_SUITE.erl
+++ b/lib/ssh/test/ssh_connection_SUITE.erl
@@ -407,7 +407,7 @@ do_interrupted_send(Config, SendSize, EchoSize) ->
Parent ! {self(), channelId, ChannelId},
Result =
- try collect_data(ConnectionRef, ChannelId)
+ try collect_data(ConnectionRef, ChannelId, EchoSize)
of
ExpectedData ->
ct:log("~p:~p got expected data",[?MODULE,?LINE]),
@@ -931,23 +931,25 @@ big_cat_rx(ConnectionRef, ChannelId, Acc) ->
timeout
end.
-collect_data(ConnectionRef, ChannelId) ->
+collect_data(ConnectionRef, ChannelId, EchoSize) ->
ct:log("~p:~p Listener ~p running! ConnectionRef=~p, ChannelId=~p",[?MODULE,?LINE,self(),ConnectionRef,ChannelId]),
- collect_data(ConnectionRef, ChannelId, [], 0).
+ collect_data(ConnectionRef, ChannelId, EchoSize, [], 0).
-collect_data(ConnectionRef, ChannelId, Acc, Sum) ->
+collect_data(ConnectionRef, ChannelId, EchoSize, Acc, Sum) ->
TO = 5000,
receive
{ssh_cm, ConnectionRef, {data, ChannelId, 0, Data}} when is_binary(Data) ->
- ct:log("~p:~p collect_data: received ~p bytes. total ~p bytes",[?MODULE,?LINE,size(Data),Sum+size(Data)]),
+ ct:log("~p:~p collect_data: received ~p bytes. total ~p bytes, want ~p more",
+ [?MODULE,?LINE,size(Data),Sum+size(Data),EchoSize-Sum]),
ssh_connection:adjust_window(ConnectionRef, ChannelId, size(Data)),
- collect_data(ConnectionRef, ChannelId, [Data | Acc], Sum+size(Data));
+ collect_data(ConnectionRef, ChannelId, EchoSize, [Data | Acc], Sum+size(Data));
{ssh_cm, ConnectionRef, {eof, ChannelId}} ->
try
iolist_to_binary(lists:reverse(Acc))
of
Bin ->
- ct:log("~p:~p collect_data: received eof.~nGot in total ~p bytes",[?MODULE,?LINE,size(Bin)]),
+ ct:log("~p:~p collect_data: received eof.~nGot in total ~p bytes, want ~p more",
+ [?MODULE,?LINE,size(Bin),EchoSize,size(Bin)]),
Bin
catch
C:E ->
@@ -957,11 +959,11 @@ collect_data(ConnectionRef, ChannelId, Acc, Sum) ->
end;
Msg ->
ct:log("~p:~p collect_data: ***** unexpected message *****~n~p",[?MODULE,?LINE,Msg]),
- collect_data(ConnectionRef, ChannelId, Acc, Sum)
+ collect_data(ConnectionRef, ChannelId, EchoSize, Acc, Sum)
after TO ->
ct:log("~p:~p collect_data: ----- Nothing received for ~p seconds -----~n",[?MODULE,?LINE,TO]),
- collect_data(ConnectionRef, ChannelId, Acc, Sum)
+ collect_data(ConnectionRef, ChannelId, EchoSize, Acc, Sum)
end.
%%%-------------------------------------------------------------------