25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

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

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>>);