mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
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.
This commit is contained in:
parent
1579bf2d18
commit
70c247d357
@ -153,8 +153,10 @@ tls_to_tcp(#tlssock{tcpsock = TCPSocket, tlsport = Port}) ->
|
|||||||
recv(Socket, Length) ->
|
recv(Socket, Length) ->
|
||||||
recv(Socket, Length, infinity).
|
recv(Socket, Length, infinity).
|
||||||
recv(#tlssock{tcpsock = TCPSocket} = TLSSock,
|
recv(#tlssock{tcpsock = TCPSocket} = TLSSock,
|
||||||
Length, Timeout) ->
|
_Length, Timeout) ->
|
||||||
case gen_tcp:recv(TCPSocket, Length, Timeout) of
|
%% 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} ->
|
{ok, Packet} ->
|
||||||
recv_data(TLSSock, Packet);
|
recv_data(TLSSock, Packet);
|
||||||
{error, _Reason} = Error ->
|
{error, _Reason} = Error ->
|
||||||
|
Loading…
Reference in New Issue
Block a user