aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun_http.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gun_http.erl')
-rw-r--r--src/gun_http.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gun_http.erl b/src/gun_http.erl
index e05bcf8..846ca4c 100644
--- a/src/gun_http.erl
+++ b/src/gun_http.erl
@@ -60,9 +60,10 @@ handle(Data, State=#http_state{in=body_close}) ->
State;
handle(Data, State=#http_state{in=body_chunked, in_state=InState,
buffer=Buffer, connection=Conn}) ->
- case cow_http_te:stream_chunked(<< Buffer/binary, Data/binary >>, InState) of
+ Buffer2 = << Buffer/binary, Data/binary >>,
+ case cow_http_te:stream_chunked(Buffer2, InState) of
more ->
- State;
+ State#http_state{buffer=Buffer2};
{more, Data2, InState2} ->
send_data_if_alive(Data2, State, nofin),
State#http_state{buffer= <<>>, in_state=InState2};