+{-# LANGUAGE
+ BangPatterns
+ #-}
module Network.HTTP.Lucu.Preprocess
( preprocess
)
-}
preprocess :: Interaction -> STM ()
-preprocess itr
- = itr `seq`
- do req <- readItr itr itrRequest fromJust
+preprocess !itr
+ = do req <- readItr itr itrRequest fromJust
let reqVer = reqVersion req
updateAuthority :: Strict.ByteString -> Strict.ByteString -> STM ()
- updateAuthority host portStr
- = host `seq` portStr `seq`
- updateItr itr itrRequest
+ updateAuthority !host !portStr
+ = updateItr itr itrRequest
$! \ (Just req) -> Just req {
reqURI = let uri = reqURI req
in uri {
preprocessHeader :: Request -> STM ()
- preprocessHeader req
- = req `seq`
- do case getHeader (C8.pack "Expect") req of
+ preprocessHeader !req
+ = do case getHeader (C8.pack "Expect") req of
Nothing -> return ()
Just value -> if value `noCaseEq` C8.pack "100-continue" then
writeItr itr itrExpectedContinue True