@@ -2,7 +2,10 @@
22{-# LANGUAGE OverloadedStrings #-}
33{-# LANGUAGE CPP #-}
44
5−module Network.Wai.Handler.Warp.Request where
5+module Network.Wai.Handler.Warp.Request (
6+ recvRequest
7+ , takeHeaders
8+ ) where
69
710import Control.Applicative
811import Control.Exception.Lifted (throwIO)
@@ -15,7 +18,6 @@ import qualified Data.CaseInsensitive as CI
1518import Data.Conduit
1619import qualified Data.IORef as I
1720import Data.Monoid (mempty)
18−import Data.Word (Word8)
1921import qualified Network.HTTP.Types as H
2022import Network.Socket (SockAddr)
2123import Network.Wai
@@ -114,13 +116,6 @@ recvRequest' conn timeoutHandle (firstLine:otherLines) remoteHost' src = do
114116#endif
115117 }, getSource)
116118
117−{-# INLINE takeUntil #-}
118−takeUntil :: Word8 -> ByteString -> ByteString
119−takeUntil c bs =
120− case S.elemIndex c bs of
121− Just !idx -> SU.unsafeTake idx bs
122− Nothing -> bs
123−
124119{-# INLINE parseFirst #-} -- FIXME is this inline necessary? the function is only called from one place and not exported
125120parseFirst :: ByteString
126121 -> IO (ByteString, ByteString, ByteString, H.HttpVersion)