0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

fix badarith on commands

This commit is contained in:
Alexandre Rodrigues 2020-02-05 13:41:49 +01:00
parent 752297b153
commit 19faf0ae7f

View file

@ -970,6 +970,9 @@ commands(State=#state{out_streamid=Current, streams=Streams0}, StreamID, Command
Streams = lists:keyreplace(StreamID, #stream.id, Streams0, Streams = lists:keyreplace(StreamID, #stream.id, Streams0,
Stream#stream{queue=Queue ++ Commands}), Stream#stream{queue=Queue ++ Commands}),
State#state{streams=Streams}; State#state{streams=Streams};
%% When we have finished reading the request body, do nothing.
commands(State=#state{flow=infinity}, StreamID, [{flow, _}|Tail]) ->
commands(State, StreamID, Tail);
%% Read the request body. %% Read the request body.
commands(State0=#state{flow=Flow0}, StreamID, [{flow, Size}|Tail]) -> commands(State0=#state{flow=Flow0}, StreamID, [{flow, Size}|Tail]) ->
%% We must read *at least* Size of data otherwise functions %% We must read *at least* Size of data otherwise functions