diff --git a/src/ejabberd_http.erl b/src/ejabberd_http.erl index 6d54a7eda..920361017 100644 --- a/src/ejabberd_http.erl +++ b/src/ejabberd_http.erl @@ -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), <>);