Skip to content

Commit

Permalink
Delete stream regardless of error in data_frame1
Browse files Browse the repository at this point in the history
  • Loading branch information
zuiderkwast committed Oct 10, 2022
1 parent 447c17c commit 6b2b655
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/gun_http2.erl
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ maybe_ack_or_notify(State=#http2_state{reply_to=ReplyTo, socket=Socket,
data_frame(State0, StreamID, IsFin, Data, CookieStore0, EvHandler, EvHandlerState0) ->
case get_stream_by_id(State0, StreamID) of
Stream=#stream{tunnel=undefined} ->
{StateOrError, EvHandlerState} = data_frame1(State0,
{Commands, EvHandlerState} = data_frame1(State0,
StreamID, IsFin, Data, EvHandler, EvHandlerState0, Stream),
{StateOrError, CookieStore0, EvHandlerState};
{Commands, CookieStore0, EvHandlerState};
Stream=#stream{tunnel=#tunnel{protocol=Proto, protocol_state=ProtoState0}} ->
% %% @todo What about IsFin?
{Commands, CookieStore, EvHandlerState1} = Proto:handle(Data,
Expand Down Expand Up @@ -445,13 +445,13 @@ data_frame1(State0, StreamID, IsFin, Data, EvHandler, EvHandlerState0,
{update_window(State1), EvHandlerState1}
end
end,
case StateOrError of
{state, State} ->
{{state, maybe_delete_stream(State, StreamID, remote, IsFin)},
EvHandlerState};
{State, Errors} = case StateOrError of
{state, State2} ->
{State2, []};
Error={error, _} ->
{Error, EvHandlerState}
end.
{State1, [Error]}
end,
{[{state, maybe_delete_stream(State, StreamID, remote, IsFin)} | Errors], EvHandlerState}.

headers_frame(State0=#http2_state{opts=Opts},
StreamID, IsFin, Headers, #{status := Status}, _BodyLen,
Expand Down

0 comments on commit 6b2b655

Please sign in to comment.