aboutsummaryrefslogtreecommitdiffstats
path: root/src/cow_http2_machine.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/cow_http2_machine.erl')
-rw-r--r--src/cow_http2_machine.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cow_http2_machine.erl b/src/cow_http2_machine.erl
index 0cf99fb..b51aeac 100644
--- a/src/cow_http2_machine.erl
+++ b/src/cow_http2_machine.erl
@@ -1306,6 +1306,8 @@ queue_data(Stream=#stream{local_buffer=Q0, local_buffer_size=Size0}, IsFin, Data
%% a result, it is the responsibility of the caller to ensure that
%% the Size argument is never lower than 0.
+-spec ensure_window(non_neg_integer(), State)
+ -> ok | {ok, pos_integer(), State} when State::http2_machine().
ensure_window(Size, State=#http2_machine{opts=Opts, remote_window=RemoteWindow}) ->
case ensure_window(Size, RemoteWindow, connection, Opts) of
ok ->
@@ -1314,6 +1316,8 @@ ensure_window(Size, State=#http2_machine{opts=Opts, remote_window=RemoteWindow})
{ok, Increment, State#http2_machine{remote_window=RemoteWindow + Increment}}
end.
+-spec ensure_window(cow_http2:streamid(), non_neg_integer(), State)
+ -> ok | {ok, pos_integer(), State} when State::http2_machine().
ensure_window(StreamID, Size, State=#http2_machine{opts=Opts}) ->
Stream = #stream{remote_window=RemoteWindow} = stream_get(StreamID, State),
case ensure_window(Size, RemoteWindow, stream, Opts) of