From 70c247d3571862f376166955f6f89fe30693039d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6hler?= Date: Fri, 22 Oct 2010 19:51:23 +0200 Subject: [PATCH] Ignore Length argument to tls:recv/[23] (EJAB-1327) The Length argument cannot be used for gen_tcp:recv/3, because the compressed size does not equal the desired uncompressed one. --- src/tls/tls.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tls/tls.erl b/src/tls/tls.erl index ffbae68c9..e307ae71e 100644 --- a/src/tls/tls.erl +++ b/src/tls/tls.erl @@ -153,8 +153,10 @@ tls_to_tcp(#tlssock{tcpsock = TCPSocket, tlsport = Port}) -> recv(Socket, Length) -> recv(Socket, Length, infinity). recv(#tlssock{tcpsock = TCPSocket} = TLSSock, - Length, Timeout) -> - case gen_tcp:recv(TCPSocket, Length, Timeout) of + _Length, Timeout) -> + %% The Length argument cannot be used for gen_tcp:recv/3, because the + %% compressed size does not equal the desired uncompressed one. + case gen_tcp:recv(TCPSocket, 0, Timeout) of {ok, Packet} -> recv_data(TLSSock, Packet); {error, _Reason} = Error ->