@@ -7,7 +7,6 @@ module Network.Wai.Handler.Warp.HTTP2.Sender (frameSender) where
77#if __GLASGOW_HASKELL__ < 709
88import Control.Applicative
99#endif
10−import Control.Concurrent (forkIO)
1110import Control.Concurrent.STM
1211import qualified Control.Exception as E
1312import Control.Monad (unless, void, when)
@@ -182,12 +181,7 @@ frameSender ctx@Context{outputQ,connectionWindow}
182181 maybeEnqueueNext :: Stream -> Control DynaNext -> IO ()
183182 maybeEnqueueNext strm (CNext next) = do
184183 let out = ONext strm next
185− sw <- atomically $ readTVar $ streamWindow strm
186− if sw == 0 then
187− void $ forkIO $ enqueueWhenWindowIsOpen outputQ out
188− else do
189− pri <- readIORef $ streamPriority strm
190− enqueue outputQ out pri
184+ enqueueOrSpawnTemporaryWaiter strm outputQ out
191185 -- If the streaming is not finished, it must already have been
192186 -- written to the 'TVar' owned by 'waiter', which will
193187 -- put it back into the queue when more output becomes available.