Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP/2: check window sizes, implement streaming #158

Merged
merged 8 commits into from
Dec 12, 2021
Prev Previous commit
don't call IO.iodata_to_binary/1 on binary input
the-mikedavis committed Dec 6, 2021
commit 466bf4bd6ca1d2b3ad473be3023a7fd28d682cc2
10 changes: 7 additions & 3 deletions lib/finch/http2/request_stream.ex
Original file line number Diff line number Diff line change
@@ -11,9 +11,13 @@ defmodule Finch.HTTP2.RequestStream do
end

enumerable =
Stream.map(enumerable, fn data ->
binary_data = IO.iodata_to_binary(data)
{binary_data, byte_size(binary_data)}
Stream.map(enumerable, fn
binary when is_binary(binary) ->
{binary, byte_size(binary)}

io_data ->
binary = IO.iodata_to_binary(io_data)
{binary, byte_size(binary)}
end)

reducer = &reduce_with_suspend/2