@@ -169,15 +169,15 @@ serveConnection th onException port app conn remoteHost' = do
169169 where
170170 fromClient = enumSocket th bytesPerRead conn
171171 serveConnection' = do
172− (enumeratee, env) <- parseRequest port remoteHost'
172+ (len, env) <- parseRequest port remoteHost'
173173 -- Let the application run for as long as it wants
174174 liftIO $ T.pause th
175− res <- E.joinI $ enumeratee $$ app env
175+ res <- E.joinI $ EB.isolate len $$ app env
176176 liftIO $ T.resume th
177177 keepAlive <- liftIO $ sendResponse th env (httpVersion env) conn res
178178 if keepAlive then serveConnection' else return ()
179179
180−parseRequest :: Port -> SockAddr -> E.Iteratee S.ByteString IO (E.Enumeratee ByteString ByteString IO a, Request)
180+parseRequest :: Port -> SockAddr -> E.Iteratee S.ByteString IO (Integer, Request)
181181parseRequest port remoteHost' = do
182182 headers' <- takeHeaders
183183 parseRequest' port headers' remoteHost'
@@ -205,7 +205,7 @@ instance Exception InvalidRequest
205205parseRequest' :: Port
206206 -> [ByteString]
207207 -> SockAddr
208− -> E.Iteratee S.ByteString IO (E.Enumeratee S.ByteString S.ByteString IO a, Request)
208+ -> E.Iteratee S.ByteString IO (Integer, Request)
209209parseRequest' _ [] _ = E.throwError $ NotEnoughLines []
210210parseRequest' port (firstLine:otherLines) remoteHost' = do
211211 (method, rpath', gets, httpversion) <- parseFirst firstLine
@@ -224,7 +224,7 @@ parseRequest' port (firstLine:otherLines) remoteHost' = do
224224 let serverName' = takeUntil 58 host -- ':'
225225 -- FIXME isolate takes an Integer instead of Int or Int64. If this is a
226226 -- performance penalty, we may need our own version.
227− return (EB.isolate len, Request
227+ return (len, Request
228228 { requestMethod = method
229229 , httpVersion = httpversion
230230 , pathInfo = H.decodePathSegments rpath