aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2016-10-04 15:00:54 +0200
committerIngela Anderton Andin <[email protected]>2016-10-04 15:00:54 +0200
commit43319147e3aa0145303dcb5bd9799b4766618afa (patch)
tree99e4145de9e61002d0f9541b2b80d46be29ead8a /lib
parent531d64f4c7a232c60e81726ae2b4be8788551b22 (diff)
parentf98390d5100bf340bce2ede86be02955419f2c0a (diff)
downloadotp-43319147e3aa0145303dcb5bd9799b4766618afa.tar.gz
otp-43319147e3aa0145303dcb5bd9799b4766618afa.tar.bz2
otp-43319147e3aa0145303dcb5bd9799b4766618afa.zip
Merge branch 'maint'
Diffstat (limited to 'lib')
-rw-r--r--lib/ssl/test/ssl_packet_SUITE.erl29
1 files changed, 11 insertions, 18 deletions
diff --git a/lib/ssl/test/ssl_packet_SUITE.erl b/lib/ssl/test/ssl_packet_SUITE.erl
index 81a49776e4..942e68967a 100644
--- a/lib/ssl/test/ssl_packet_SUITE.erl
+++ b/lib/ssl/test/ssl_packet_SUITE.erl
@@ -2011,26 +2011,19 @@ active_once_raw(Socket, Data, N) ->
active_once_raw(_, _, 0, _) ->
ok;
-active_once_raw(Socket, Data, N, Acc) ->
- receive
- {ssl, Socket, Byte} when length(Byte) == 1 ->
- ssl:setopts(Socket, [{active, once}]),
+active_once_raw(Socket, Data, N, Acc0) ->
+ case lists:prefix(Data, Acc0) of
+ true ->
+ DLen = length(Data),
+ Start = DLen + 1,
+ Len = length(Acc0) - DLen,
+ Acc = string:substr(Acc0, Start, Len),
+ active_once_raw(Socket, Data, N-1, Acc);
+ false ->
receive
- {ssl, Socket, _} ->
- ssl:setopts(Socket, [{active, once}]),
- active_once_raw(Socket, Data, N-1, [])
- end;
- {ssl, Socket, Data} ->
- ssl:setopts(Socket, [{active, once}]),
- active_once_raw(Socket, Data, N-1, []);
- {ssl, Socket, Other} ->
- case Acc ++ Other of
- Data ->
- ssl:setopts(Socket, [{active, once}]),
- active_once_raw(Socket, Data, N-1, []);
- NewAcc ->
+ {ssl, Socket, Info} ->
ssl:setopts(Socket, [{active, once}]),
- active_once_raw(Socket, Data, N, NewAcc)
+ active_once_raw(Socket, Data, N, Acc0 ++ Info)
end
end.