Skip to content

Commit

Permalink
Fix a problem with streams.
Browse files Browse the repository at this point in the history
Upgrade cowboy to 2.9.0
  • Loading branch information
mworrell committed Nov 16, 2021
1 parent 11526b5 commit 994d6da
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
6 changes: 3 additions & 3 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
%%-*- mode: erlang -*-

{require_min_otp_vsn, "22"}.
{require_min_otp_vsn, "22.3"}.

{plugins, [rebar3_hex]}.

{deps, [
{zotonic_stdlib, "1.2.11"},
{cowboy, "2.8.0"}
{zotonic_stdlib, "1.5.9"},
{cowboy, "2.9.0"}
]}.

{profiles, [
Expand Down
30 changes: 18 additions & 12 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
{"1.2.0",
[{<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.8.0">>},0},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.9.1">>},1},
{<<"ranch">>,{pkg,<<"ranch">>,<<"1.7.1">>},1},
{<<"zotonic_stdlib">>,{pkg,<<"zotonic_stdlib">>,<<"1.2.11">>},0}]}.
[{<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.9.0">>},0},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.11.0">>},1},
{<<"ranch">>,{pkg,<<"ranch">>,<<"1.8.0">>},1},
{<<"ssl_verify_fun">>,{pkg,<<"ssl_verify_fun">>,<<"1.1.6">>},2},
{<<"tls_certificate_check">>,{pkg,<<"tls_certificate_check">>,<<"1.8.0">>},1},
{<<"zotonic_stdlib">>,{pkg,<<"zotonic_stdlib">>,<<"1.5.9">>},0}]}.
[
{pkg_hash,[
{<<"cowboy">>, <<"F3DC62E35797ECD9AC1B50DB74611193C29815401E53BAC9A5C0577BD7BC667D">>},
{<<"cowlib">>, <<"61A6C7C50CF07FDD24B2F45B89500BB93B6686579B069A89F88CB211E1125C78">>},
{<<"ranch">>, <<"6B1FAB51B49196860B733A49C07604465A47BDB78AA10C1C16A3D199F7F8C881">>},
{<<"zotonic_stdlib">>, <<"CAB477495E4C1D265118A4E71780D6A5C571ABB3155F2D7C2A84C5AC915A69C6">>}]},
{<<"cowboy">>, <<"865DD8B6607E14CF03282E10E934023A1BD8BE6F6BACF921A7E2A96D800CD452">>},
{<<"cowlib">>, <<"0B9FF9C346629256C42EBE1EEB769A83C6CB771A6EE5960BD110AB0B9B872063">>},
{<<"ranch">>, <<"8C7A100A139FD57F17327B6413E4167AC559FBC04CA7448E9BE9057311597A1D">>},
{<<"ssl_verify_fun">>, <<"CF344F5692C82D2CD7554F5EC8FD961548D4FD09E7D22F5B62482E5AEAEBD4B0">>},
{<<"tls_certificate_check">>, <<"8A41A435C8055CB11D1D0AC96B34F48377D49FEA2782D70EABCF8946539946A3">>},
{<<"zotonic_stdlib">>, <<"64BFCBBF42511E22BBFF254609C68E19D3458924EE7E357E03190C5CC29A204B">>}]},
{pkg_hash_ext,[
{<<"cowboy">>, <<"4643E4FBA74AC96D4D152C75803DE6FAD0B3FA5DF354C71AFDD6CBEEB15FAC8A">>},
{<<"cowlib">>, <<"E4175DC240A70D996156160891E1C62238EDE1729E45740BDD38064DAD476170">>},
{<<"ranch">>, <<"451D8527787DF716D99DC36162FCA05934915DB0B6141BBDAC2EA8D3C7AFC7D7">>},
{<<"zotonic_stdlib">>, <<"F3AE8AA22E5ECF3A8D329283CE24A8A6F9340004BDF59915E4E373FCB6F22FB5">>}]}
{<<"cowboy">>, <<"2C729F934B4E1AA149AFF882F57C6372C15399A20D54F65C8D67BEF583021BDE">>},
{<<"cowlib">>, <<"2B3E9DA0B21C4565751A6D4901C20D1B4CC25CBB7FD50D91D2AB6DD287BC86A9">>},
{<<"ranch">>, <<"49FBCFD3682FAB1F5D109351B61257676DA1A2FDBE295904176D5E521A2DDFE5">>},
{<<"ssl_verify_fun">>, <<"BDB0D2471F453C88FF3908E7686F86F9BE327D065CC1EC16FA4540197EA04680">>},
{<<"tls_certificate_check">>, <<"5211FD87B4FEFAA77F2DE1F03479CBC4EE8312738A21B9B905253674468928F2">>},
{<<"zotonic_stdlib">>, <<"AEBFC5C41989FE76458C3739269021D144454B94915F18B9E7A6249CA2F7CF0F">>}]}
].
4 changes: 2 additions & 2 deletions src/cowmachine_response.erl
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ send_response_bodyfun({device, Length, IO}, Code, all, Context) ->
Writer = fun(FunContext) ->
send_device_body(FunContext, Length, IO),
_ = file:close(IO),
{fin, FunContext}
FunContext
end,
start_response_stream(Code, Length, Writer, all, Context);
send_response_bodyfun({device, _Length, IO}, Code, Parts, Context) ->
Writer = fun(FunContext, WParts) ->
FunContext1 = send_device_body_parts(FunContext, WParts, IO),
_ = file:close(IO),
{fin, FunContext1}
FunContext1
end,
start_response_stream(Code, undefined, Writer, Parts, Context);
% File
Expand Down

0 comments on commit 994d6da

Please sign in to comment.