aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-05-19 16:42:37 +0200
committerLoïc Hoguin <[email protected]>2017-05-19 16:42:37 +0200
commit0d5b36e1ba765c4aef84449e76c8ab8061074f96 (patch)
tree891921b2b33e951db2cc3d07f4f4a34a150ff962 /src
parent15750e632d9886eb9bfc876ba03402464b8facb3 (diff)
downloadcowlib-0d5b36e1ba765c4aef84449e76c8ab8061074f96.tar.gz
cowlib-0d5b36e1ba765c4aef84449e76c8ab8061074f96.tar.bz2
cowlib-0d5b36e1ba765c4aef84449e76c8ab8061074f96.zip
Add functions for creating WINDOW_UPDATE h2 frames
Diffstat (limited to 'src')
-rw-r--r--src/cow_http2.erl8
-rw-r--r--src/cow_multipart.erl1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/cow_http2.erl b/src/cow_http2.erl
index 460e6f1..efc3ad8 100644
--- a/src/cow_http2.erl
+++ b/src/cow_http2.erl
@@ -31,6 +31,8 @@
-export([ping/1]).
-export([ping_ack/1]).
-export([goaway/3]).
+-export([window_update/1]).
+-export([window_update/2]).
-type streamid() :: pos_integer().
-type fin() :: fin | nofin.
@@ -389,6 +391,12 @@ goaway(LastStreamID, Reason, DebugData) ->
Len = iolist_size(DebugData) + 8,
[<< Len:24, 7:8, 0:41, LastStreamID:31, ErrorCode:32 >>, DebugData].
+window_update(Increment) ->
+ window_update(0, Increment).
+
+window_update(StreamID, Increment) when Increment =< 16#7fffffff ->
+ << 4:24, 8:8, 0:8, StreamID:32, 0:1, Increment:31 >>.
+
flag_fin(nofin) -> 0;
flag_fin(fin) -> 1.
diff --git a/src/cow_multipart.erl b/src/cow_multipart.erl
index 3cbef56..e86afcc 100644
--- a/src/cow_multipart.erl
+++ b/src/cow_multipart.erl
@@ -538,6 +538,7 @@ form_data(Headers) ->
false -> <<"text/plain">>;
{_, T} -> T
end,
+ %% @todo Turns out this is unnecessary per RFC7578 4.7.
TransferEncoding = case lists:keyfind(
<<"content-transfer-encoding">>, 1, Headers) of
false -> <<"7bit">>;