aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-09-06 16:58:29 +0200
committerLoïc Hoguin <[email protected]>2019-09-06 16:58:29 +0200
commit2c9892cd6194d57177f9d092ffbfb34c9ecd8216 (patch)
treef9e3ebcfff1512e06d2f4575a2cec7a5a3f424fd
parent835441703a54bab9217b14ba2e787ab83c2c33c7 (diff)
downloadcowlib-2c9892cd6194d57177f9d092ffbfb34c9ecd8216.tar.gz
cowlib-2c9892cd6194d57177f9d092ffbfb34c9ecd8216.tar.bz2
cowlib-2c9892cd6194d57177f9d092ffbfb34c9ecd8216.zip
Add missing specs to cow_http2_machine:ensure_window
-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