@@ -3,7 +3,6 @@
33
44module Network.Wai.Handler.Warp.HTTP2.Request (
55 mkRequest
6− , newReadBody
76 , MkReq
87 , ValidHeaders(..)
98 , validateHeaders
@@ -12,13 +11,10 @@ module Network.Wai.Handler.Warp.HTTP2.Request (
1211#if __GLASGOW_HASKELL__ < 709
1312import Control.Applicative ((<$>))
1413#endif
15−import Control.Concurrent.STM
16−import Control.Monad (when)
1714import Data.ByteString (ByteString)
1815import qualified Data.ByteString as BS
1916import qualified Data.ByteString.Char8 as B8
2017import Data.CaseInsensitive (mk)
21−import Data.IORef (IORef, readIORef, newIORef, writeIORef)
2218import Data.Maybe (isJust)
2319import qualified Data.Vault.Lazy as Vault
2420#if __GLASGOW_HASKELL__ < 709
@@ -168,21 +164,3 @@ validateHeaders hs = case pseudo hs emptySpecial of
168164 in [("cookie",v)]
169165 isPseudo "" = False
170166 isPseudo k = BS.head k == _colon
171−
172−
173−----------------------------------------------------------------
174−
175−newReadBody :: TQueue ByteString -> IO (IO ByteString)
176−newReadBody q = do
177− ref <- newIORef False
178− return $ readBody q ref
179−
180−readBody :: TQueue ByteString -> IORef Bool -> IO ByteString
181−readBody q ref = do
182− eof <- readIORef ref
183− if eof then
184− return ""
185− else do
186− bs <- atomically $ readTQueue q
187− when (bs == "") $ writeIORef ref True
188− return bs