Skip to content

Commit

Permalink
Update the local state when preparing HTTP/3 headers
Browse files Browse the repository at this point in the history
  • Loading branch information
essen committed Mar 20, 2024
1 parent af3db83 commit 3a5a90c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/cow_http3_machine.erl
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,12 @@ prepare_headers(StreamID, State=#http3_machine{encode_state=EncodeState0},
{_, <<"HEAD">>} -> fin;
_ -> IsFin0
end,
%% With QUIC we don't have a data queue so the local state
%% can be updated immediately.
LocalIsFin = case IsFin0 of
idle -> idle;
_ -> IsFin
end,
Headers = cow_http:merge_pseudo_headers(PseudoHeaders,
cow_http:remove_http1_headers(Headers0)),
{ok, HeaderBlock, EncData, EncodeState}
Expand All @@ -627,7 +633,7 @@ prepare_headers(StreamID, State=#http3_machine{encode_state=EncodeState0},
[] -> undefined;
_ -> {encoder_instructions, EncData}
end,
stream_store(Stream#bidi_stream{local=IsFin0},
stream_store(Stream#bidi_stream{local=LocalIsFin},
State#http3_machine{encode_state=EncodeState})}.

-spec prepare_trailers(cow_http3:stream_id(), State, cow_http:headers())
Expand Down

0 comments on commit 3a5a90c

Please sign in to comment.