aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gun_http2.erl9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gun_http2.erl b/src/gun_http2.erl
index 78b137b..20e21ec 100644
--- a/src/gun_http2.erl
+++ b/src/gun_http2.erl
@@ -142,6 +142,9 @@ frame(State=#http2_state{http2_machine=HTTP2Machine0}, Frame, EvHandler, EvHandl
{ok, {data, StreamID, IsFin, Data}, HTTP2Machine} ->
data_frame(State#http2_state{http2_machine=HTTP2Machine}, StreamID, IsFin, Data,
EvHandler, EvHandlerState);
+ {ok, {lingering_data, _StreamID, DataLen}, HTTP2Machine} ->
+ {lingering_data_frame(State#http2_state{http2_machine=HTTP2Machine}, DataLen),
+ EvHandlerState};
{ok, {headers, StreamID, IsFin, Headers, PseudoHeaders, BodyLen}, HTTP2Machine} ->
headers_frame(State#http2_state{http2_machine=HTTP2Machine},
StreamID, IsFin, Headers, PseudoHeaders, BodyLen,
@@ -180,6 +183,12 @@ maybe_ack(State=#http2_state{socket=Socket, transport=Transport}, Frame) ->
end,
State.
+lingering_data_frame(State=#http2_state{socket=Socket, transport=Transport,
+ http2_machine=HTTP2Machine0}, DataLen) ->
+ Transport:send(Socket, cow_http2:window_update(DataLen)),
+ HTTP2Machine1 = cow_http2_machine:update_window(DataLen, HTTP2Machine0),
+ State#http2_state{http2_machine=HTTP2Machine1}.
+
data_frame(State=#http2_state{socket=Socket, transport=Transport,
http2_machine=HTTP2Machine0}, StreamID, IsFin, Data,
EvHandler, EvHandlerState0) ->