From 2c9892cd6194d57177f9d092ffbfb34c9ecd8216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 6 Sep 2019 16:58:29 +0200 Subject: Add missing specs to cow_http2_machine:ensure_window --- src/cow_http2_machine.erl | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3