ejabberd_http: Cope with large POST/PUT requests

gen_tcp returns 'enomem' if we try to receive more than 64 MiB.
This commit is contained in:
Holger Weiss 2015-12-20 23:30:11 +01:00
parent d039b9b72b
commit 2d22507636
1 changed files with 2 additions and 2 deletions

View File

@ -513,8 +513,8 @@ recv_data(#state{trail = Trail} = State, Len, <<>>) when byte_size(Trail) > Len
recv_data(State, Len, Acc) ->
case State#state.trail of
<<>> ->
case (State#state.sockmod):recv(State#state.socket, Len,
300000)
case (State#state.sockmod):recv(State#state.socket,
min(Len, 16#4000000), 300000)
of
{ok, Data} ->
recv_data(State, Len - byte_size(Data), <<Acc/binary, Data/binary>>);