Skip to content

Commit

Permalink
Merge PR #140
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Aug 8, 2024
2 parents f520e47 + fd8098b commit c913fa5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Network/HTTP2/H2/Sender.hs
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,23 @@ frameSender
_
reqflush = do
let buf = confWriteBuffer `plusPtr` off
off' = off + frameHeaderLength + datPayloadLen
(mtrailers, flag) <- do
Trailers trailers <- tlrmkr Nothing
if null trailers
then return (Nothing, setEndStream defaultFlags)
else return (Just trailers, defaultFlags)
fillFrameHeader FrameData datPayloadLen streamNumber flag buf
-- Avoid sending an empty data frame before trailers at the end
-- of a stream
off' <-
if datPayloadLen /= 0 || isNothing mtrailers then do
decreaseWindowSize ctx strm datPayloadLen
fillFrameHeader FrameData datPayloadLen streamNumber flag buf
return $ off + frameHeaderLength + datPayloadLen
else
return off
off'' <- handleTrailers mtrailers off'
_ <- sync Nothing
halfClosedLocal ctx strm Finished
decreaseWindowSize ctx strm datPayloadLen
if reqflush
then do
flushN off''
Expand Down

0 comments on commit c913fa5

Please sign in to comment.