diff options
author | Loïc Hoguin <[email protected]> | 2017-10-21 21:01:40 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2017-10-21 21:01:40 +0100 |
commit | 76f4db863e230638f0c9b018c5bd3586799cd7ba (patch) | |
tree | 0c0271b3deb48929d09e88ed4207c9c5a88d6552 /src | |
parent | c4651261b652ce2727b9181ef171ce7ca6add1b6 (diff) | |
download | cowboy-76f4db863e230638f0c9b018c5bd3586799cd7ba.tar.gz cowboy-76f4db863e230638f0c9b018c5bd3586799cd7ba.tar.bz2 cowboy-76f4db863e230638f0c9b018c5bd3586799cd7ba.zip |
Fix sending of final chunk in HTTP/1.1
I broke this when fixing stream handlers earlier.
Diffstat (limited to 'src')
-rw-r--r-- | src/cowboy_http.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl index 9441700..4ff9f8c 100644 --- a/src/cowboy_http.erl +++ b/src/cowboy_http.erl @@ -846,7 +846,13 @@ commands(State0=#state{socket=Socket, transport=Transport, streams=Streams}, Str %% @todo Same as above. case lists:keyfind(StreamID, #stream.id, Streams) of #stream{version='HTTP/1.1'} -> - Transport:send(Socket, [integer_to_binary(Size, 16), <<"\r\n">>, Data, <<"\r\n">>]); + Transport:send(Socket, [ + integer_to_binary(Size, 16), <<"\r\n">>, Data, + case IsFin of + fin -> <<"\r\n0\r\n\r\n">>; + nofin -> <<"\r\n">> + end + ]); #stream{version='HTTP/1.0'} -> Transport:send(Socket, Data) end |