Skip to content

Commit

Permalink
removing yeild which is now meaningless in the new arch
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Jul 8, 2024
1 parent bba7668 commit c768049
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions Network/HTTP2/H2/Receiver.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,17 @@ rstRateLimit = 4
frameReceiver :: Context -> Config -> IO ()
frameReceiver ctx@Context{..} conf@Config{..} = do
labelMe "H2 receiver"
loop 0 `E.catch` sendGoaway
loop `E.catch` sendGoaway
where
loop :: Int -> IO ()
loop n
| n == 6 = do
yield
loop 0
| otherwise = do
-- If 'confReadN' is timeouted, an exception is thrown
-- to destroy the thread trees.
hd <- confReadN frameHeaderLength
if BS.null hd
then enqueueControl controlQ $ CFinish ConnectionIsClosed
else do
processFrame ctx conf $ decodeFrameHeader hd
loop (n + 1)
loop = do
-- If 'confReadN' is timeouted, an exception is thrown
-- to destroy the thread trees.
hd <- confReadN frameHeaderLength
if BS.null hd
then enqueueControl controlQ CFinish
else do
processFrame ctx conf $ decodeFrameHeader hd
loop

sendGoaway se
| Just e@ConnectionIsClosed <- E.fromException se = do
Expand Down

0 comments on commit c768049

Please sign in to comment.