Skip to content

Commit

Permalink
fixing typos
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Sep 1, 2023
1 parent e41e3f6 commit c9bd5aa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Network/HTTP2/Client/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ sendRequest ctx@Context{..} mgr scheme auth (Request req) processResponse = do
-- when its 'Output' is enqueued into 'outputQ'.
-- Otherwise, it would be re-enqueue because of empty
-- resulting in out-of-order.
-- To implement this, 'tbqNonMmpty' is used.
-- To implement this, 'tbqNonEmpty' is used.
let hdr1 | scheme /= "" = (":scheme", scheme) : hdr0
| otherwise = hdr0
hdr2 | auth /= "" = (":authority", auth) : hdr1
Expand All @@ -92,17 +92,17 @@ sendRequest ctx@Context{..} mgr scheme auth (Request req) processResponse = do
stream :: OutObj -> StreamId -> Stream -> ((forall x. IO x -> IO x) -> (Builder -> IO ()) -> IO () -> IO ()) -> IO ()
stream req' sid newstrm strmbdy = do
tbq <- newTBQueueIO 10 -- fixme: hard coding: 10
tbqNonMmpty <- newTVarIO False
tbqNonEmpty <- newTVarIO False
forkManagedUnmask mgr $ \unmask -> do
let push b = atomically $ do
writeTBQueue tbq (StreamingBuilder b)
writeTVar tbqNonMmpty True
writeTVar tbqNonEmpty True
flush = atomically $ writeTBQueue tbq StreamingFlush
strmbdy unmask push flush
atomically $ writeTBQueue tbq StreamingFinished
atomically $ do
sidOK <- readTVar outputQStreamID
ready <- readTVar tbqNonMmpty
ready <- readTVar tbqNonEmpty
check (sidOK == sid && ready)
writeTVar outputQStreamID (sid + 2)
writeTQueue outputQ $ Output newstrm req' OObj (Just tbq) (return ())
Expand Down

0 comments on commit c9bd5aa

Please sign in to comment.