diff options
author | Loïc Hoguin <[email protected]> | 2019-01-06 11:16:13 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-01-06 11:21:55 +0100 |
commit | 8336270331c8ffdc04e79f069df5b051adc62e68 (patch) | |
tree | 32b22677ab145900136d7dd9c76f9012ea7ac56a /src | |
parent | 531bcb080b24d4edc061405f11747d7631ccab39 (diff) | |
download | gun-8336270331c8ffdc04e79f069df5b051adc62e68.tar.gz gun-8336270331c8ffdc04e79f069df5b051adc62e68.tar.bz2 gun-8336270331c8ffdc04e79f069df5b051adc62e68.zip |
Fix KilledStreams value for HTTP for connection: close responses
Diffstat (limited to 'src')
-rw-r--r-- | src/gun_http.erl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gun_http.erl b/src/gun_http.erl index e6b597c..376f431 100644 --- a/src/gun_http.erl +++ b/src/gun_http.erl @@ -142,7 +142,7 @@ handle(Data, State=#http_state{in=body_chunked, in_state=InState, {no_trailers, keepalive} -> handle(Rest, end_stream(State1#http_state{buffer= <<>>})); {no_trailers, close} -> - close + [{state, end_stream(State1)}, close] end; {done, Data2, HasTrailers, Rest} -> IsFin = case HasTrailers of @@ -156,7 +156,7 @@ handle(Data, State=#http_state{in=body_chunked, in_state=InState, {no_trailers, keepalive} -> handle(Rest, end_stream(State1#http_state{buffer= <<>>})); {no_trailers, close} -> - close + [{state, end_stream(State1)}, close] end end; handle(Data, State=#http_state{in=body_trailer, buffer=Buffer, connection=Conn, @@ -172,7 +172,7 @@ handle(Data, State=#http_state{in=body_trailer, buffer=Buffer, connection=Conn, keepalive -> handle(Rest, end_stream(State#http_state{buffer= <<>>})); close -> - close + [{state, end_stream(State)}, close] end end; %% We know the length of the rest of the body. @@ -189,7 +189,7 @@ handle(Data, State=#http_state{in={body, Length}, connection=Conn}) -> State1 = send_data_if_alive(Data, State, fin), case Conn of keepalive -> {state, end_stream(State1)}; - close -> close + close -> [{state, end_stream(State1)}, close] end; %% Stream finished, rest. true -> @@ -197,7 +197,7 @@ handle(Data, State=#http_state{in={body, Length}, connection=Conn}) -> State1 = send_data_if_alive(Body, State, fin), case Conn of keepalive -> handle(Rest, end_stream(State1)); - close -> close + close -> [{state, end_stream(State1)}, close] end end. |