@@ -17,7 +17,7 @@ import Data.ByteString (ByteString)
1717import qualified Data.ByteString as BS
1818import Data.Maybe (isJust)
1919import Network.HTTP2
20−import Network.HTTP2.Priority
20+import Network.HTTP2.Priority (toPrecedence, delete, prepare)
2121import Network.Wai.Handler.Warp.HTTP2.EncodeFrame
2222import Network.Wai.Handler.Warp.HTTP2.HPACK
2323import Network.Wai.Handler.Warp.HTTP2.Request
@@ -42,12 +42,12 @@ frameReceiver ctx mkreq recvN = loop 0 `E.catch` sendGoaway
4242 | Just (ConnectionError err msg) <- E.fromException e = do
4343 csid <- readIORef currentStreamId
4444 let !frame = goawayFrame csid err msg
45− enqueueControl outputQ 0 $ OGoaway frame
45+ enqueueOutputControl outputQ $ OGoaway frame
4646 | otherwise = return ()
4747
4848 sendReset err sid = do
4949 let !frame = resetFrame err sid
50− enqueueControl outputQ 0 $ OFrame frame
50+ enqueueOutputControl outputQ $ OFrame frame
5151
5252 loop :: Int -> IO ()
5353 loop !n
@@ -57,7 +57,7 @@ frameReceiver ctx mkreq recvN = loop 0 `E.catch` sendGoaway
5757 | otherwise = do
5858 hd <- recvN frameHeaderLength
5959 if BS.null hd then
60− enqueueControl outputQ 0 OFinish
60+ enqueueOutputControl outputQ OFinish
6161 else do
6262 cont <- processStreamGuardingError $ decodeFrameHeader hd
6363 when cont $ loop (n + 1)
@@ -183,7 +183,7 @@ control FrameSettings header@FrameHeader{flags} bs Context{http2settings, output
183183 unless (testAck flags) $ do
184184 modifyIORef' http2settings $ \old -> updateSettings old alist
185185 let !frame = settingsFrame setAck []
186− enqueueControl outputQ 0 $ OSettings frame alist
186+ enqueueOutputControl outputQ $ OSettings frame alist
187187 return True
188188
189189control FramePing FrameHeader{flags} bs Context{outputQ} =
@@ -191,11 +191,11 @@ control FramePing FrameHeader{flags} bs Context{outputQ} =
191191 E.throwIO $ ConnectionError ProtocolError "the ack flag of this ping frame must not be set"
192192 else do
193193 let !frame = pingFrame bs
194− enqueueControl outputQ 0 $ OFrame frame
194+ enqueueOutputControl outputQ $ OFrame frame
195195 return True
196196
197197control FrameGoAway _ _ Context{outputQ} = do
198− enqueueControl outputQ 0 OFinish
198+ enqueueOutputControl outputQ OFinish
199199 return False
200200
201201control FrameWindowUpdate header bs Context{connectionWindow} = do
@@ -269,7 +269,7 @@ stream FrameData
269269 let !frame1 = windowUpdateFrame 0 payloadLength
270270 !frame2 = windowUpdateFrame streamNumber payloadLength
271271 !frame = frame1 `BS.append` frame2
272− enqueueControl outputQ 0 $ OFrame frame
272+ enqueueOutputControl outputQ $ OFrame frame
273273 atomically $ writeTQueue q body
274274 if endOfStream then do
275275 mcl <- readIORef streamContentLength
@@ -328,8 +328,8 @@ stream FramePriority header bs Context{outputQ,priorityTreeSize} s Stream{stream
328328 else do
329329 mx <- delete outputQ streamNumber oldpre
330330 case mx of
331− Nothing -> return ()
332− Just x -> enqueue outputQ streamNumber newpre x
331+ Nothing -> return ()
332+ Just out -> enqueueOutput outputQ out
333333 return s
334334
335335-- this ordering is important