diff options
author | Sverker Eriksson <[email protected]> | 2017-11-15 14:58:02 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2017-11-15 14:58:02 +0100 |
commit | 355e7855919e2a82856b27d45cb692a087da0385 (patch) | |
tree | 6c1f8aec1d80a42c4c5cf7f5b5455da39102e2d7 /lib/kernel/test | |
parent | 0d9d1f1915ac70ba00418fd24a4293bb22c4fade (diff) | |
parent | 6a6019c287a54b71d4d0bcf0a72d244d89de90d1 (diff) | |
download | otp-355e7855919e2a82856b27d45cb692a087da0385.tar.gz otp-355e7855919e2a82856b27d45cb692a087da0385.tar.bz2 otp-355e7855919e2a82856b27d45cb692a087da0385.zip |
Merge PR-1605 from sverker/sverker/binary_to_term-used OTP-14780
Add 'used' option for binary_to_term/2
Diffstat (limited to 'lib/kernel/test')
-rw-r--r-- | lib/kernel/test/erl_distribution_wb_SUITE.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/kernel/test/erl_distribution_wb_SUITE.erl b/lib/kernel/test/erl_distribution_wb_SUITE.erl index 03aaee56b7..258ed4f88c 100644 --- a/lib/kernel/test/erl_distribution_wb_SUITE.erl +++ b/lib/kernel/test/erl_distribution_wb_SUITE.erl @@ -65,6 +65,7 @@ ?DFLAG_EXTENDED_PIDS_PORTS bor ?DFLAG_UTF8_ATOMS)). +-define(PASS_THROUGH, $p). -define(shutdown(X), exit(X)). -define(int16(X), [((X) bsr 8) band 16#ff, (X) band 16#ff]). @@ -676,10 +677,9 @@ recv_message(Socket) -> case gen_tcp:recv(Socket, 0) of {ok,Data} -> B0 = list_to_binary(Data), - {_,B1} = erlang:split_binary(B0,1), - Header = binary_to_term(B1), - Siz = byte_size(term_to_binary(Header)), - {_,B2} = erlang:split_binary(B1,Siz), + <<?PASS_THROUGH, B1/binary>> = B0, + {Header,Siz} = binary_to_term(B1,[used]), + <<_:Siz/binary,B2/binary>> = B1, Message = case (catch binary_to_term(B2)) of {'EXIT', _} -> could_not_digest_message; |