@@ -94,14 +94,14 @@ parseRequest' conn port (firstLine:otherLines) remoteHost' src = do
9494 , vault = mempty
9595 }, getSource)
9696
97−
97+{-# INLINE takeUntil #-}
9898takeUntil :: Word8 -> ByteString -> ByteString
9999takeUntil c bs =
100100 case S.elemIndex c bs of
101101 Just !idx -> SU.unsafeTake idx bs
102102 Nothing -> bs
103−{-# INLINE takeUntil #-}
104103
104+{-# INLINE parseFirst #-} -- FIXME is this inline necessary? the function is only called from one place and not exported
105105parseFirst :: ByteString
106106 -> ResourceT IO (ByteString, ByteString, ByteString, H.HttpVersion)
107107parseFirst s =
@@ -118,7 +118,6 @@ parseFirst s =
118118 in return (method, rpath, qstring, hv)
119119 else throwIO NonHttp
120120 _ -> throwIO $ BadFirstLine $ B.unpack s
121−{-# INLINE parseFirst #-} -- FIXME is this inline necessary? the function is only called from one place and not exported
122121
123122parseHeaderNoAttr :: ByteString -> H.Header
124123parseHeaderNoAttr s =
@@ -134,6 +133,7 @@ data THStatus = THStatus
134133 BSEndoList -- previously parsed lines
135134 BSEndo -- bytestrings to be prepended
136135
136+{-# INLINE takeHeaders #-}
137137takeHeaders :: Sink ByteString (ResourceT IO) [ByteString]
138138takeHeaders =
139139 await >>= maybe (throwIO ConnectionClosedByPeer) (push (THStatus 0 id id))
@@ -199,12 +199,11 @@ takeHeaders =
199199 let c = S.index bs (nl + 1)
200200 in Just (nl, c == 32 || c == 9)
201201 else Just (nl, False)
202−{-# INLINE takeHeaders #-}
203202
203+{-# INLINE checkCR #-}
204204checkCR :: ByteString -> Int -> Int
205205checkCR bs pos =
206206 let !p = pos - 1
207207 in if '\r' == B.index bs p
208208 then p
209209 else pos
210−{-# INLINE checkCR #-}