@@ -170,15 +170,15 @@ serveConnection th onException port app conn remoteHost' = do
170170 where
171171 fromClient = enumSocket th bytesPerRead conn
172172 serveConnection' = do
173− (enumeratee, env) <- parseRequest port remoteHost'
173+ (len, env) <- parseRequest port remoteHost'
174174 -- Let the application run for as long as it wants
175175 liftIO $ T.pause th
176− res <- E.joinI $ enumeratee $$ app env
176+ res <- E.joinI $ EB.isolate len $$ app env
177177 liftIO $ T.resume th
178178 keepAlive <- liftIO $ sendResponse th env (httpVersion env) conn res
179179 if keepAlive then serveConnection' else return ()
180180
181−parseRequest :: Port -> SockAddr -> E.Iteratee S.ByteString IO (E.Enumeratee ByteString ByteString IO a, Request)
181+parseRequest :: Port -> SockAddr -> E.Iteratee S.ByteString IO (Integer, Request)
182182parseRequest port remoteHost' = do
183183 headers' <- takeHeaders
184184 parseRequest' port headers' remoteHost'
@@ -206,7 +206,7 @@ instance Exception InvalidRequest
206206parseRequest' :: Port
207207 -> [ByteString]
208208 -> SockAddr
209− -> E.Iteratee S.ByteString IO (E.Enumeratee S.ByteString S.ByteString IO a, Request)
209+ -> E.Iteratee S.ByteString IO (Integer, Request)
210210parseRequest' _ [] _ = E.throwError $ NotEnoughLines []
211211parseRequest' port (firstLine:otherLines) remoteHost' = do
212212 (method, rpath', gets, httpversion) <- parseFirst firstLine
@@ -226,7 +226,7 @@ parseRequest' port (firstLine:otherLines) remoteHost' = do
226226 let serverName' = takeUntil 58 host -- ':'
227227 -- FIXME isolate takes an Integer instead of Int or Int64. If this is a
228228 -- performance penalty, we may need our own version.
229− return (EB.isolate len, Request
229+ return (len, Request
230230 { requestMethod = A.unsafeFromByteString method
231231 , httpVersion = httpversion
232232 , pathInfo = H.decodePathSegments rpath