aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Han <[email protected]>2019-12-23 20:58:58 +0800
committerLoïc Hoguin <[email protected]>2019-12-31 10:47:22 +0100
commit288b8e04d9305e4b0d9d78eef80c8bf002a35fde (patch)
tree05d1a4bb2febd82ff91c1511203d8eb704d1fb81
parentcb5dda33d986680b2778cf7afaa502428234088b (diff)
downloadcowlib-288b8e04d9305e4b0d9d78eef80c8bf002a35fde.tar.gz
cowlib-288b8e04d9305e4b0d9d78eef80c8bf002a35fde.tar.bz2
cowlib-288b8e04d9305e4b0d9d78eef80c8bf002a35fde.zip
Fix sending trailers when there are data frames in queue
-rw-r--r--src/cow_http2_machine.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cow_http2_machine.erl b/src/cow_http2_machine.erl
index 30654d0..8f7f5ea 100644
--- a/src/cow_http2_machine.erl
+++ b/src/cow_http2_machine.erl
@@ -1184,9 +1184,9 @@ send_or_queue_data(StreamID, State0=#http2_machine{opts=Opts, local_window=ConnW
_ ->
DataOrFileOrTrailers0
end,
- SendSize = BufferSize + case DataOrFileOrTrailers of
- {data, D} -> iolist_size(D);
- #sendfile{bytes=B} -> B;
+ SendSize = case DataOrFileOrTrailers of
+ {data, D} -> BufferSize + iolist_size(D);
+ #sendfile{bytes=B} -> BufferSize + B;
{trailers, _} -> 0
end,
MinSendSize = maps:get(stream_window_data_threshold, Opts, 16384),