X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FPreprocess.hs;h=9f9fa0d68c3b83f187c6316213cc100f39cdc5cf;hp=fc3fcbdfcde6cd01ce13cf36d3df3b44ddd9a45c;hb=8bdd1da1ee1f3e453dbe2bce246618e12e26d30c;hpb=f391e9a68a654b9f6477cf64330986c94bc7549d diff --git a/Network/HTTP/Lucu/Preprocess.hs b/Network/HTTP/Lucu/Preprocess.hs index fc3fcbd..9f9fa0d 100644 --- a/Network/HTTP/Lucu/Preprocess.hs +++ b/Network/HTTP/Lucu/Preprocess.hs @@ -1,3 +1,6 @@ +{-# LANGUAGE + BangPatterns + #-} module Network.HTTP.Lucu.Preprocess ( preprocess ) @@ -47,9 +50,8 @@ import Network.URI -} 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 @@ -109,9 +111,8 @@ preprocess itr 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 { @@ -125,9 +126,8 @@ preprocess itr 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