@@ -30,15 +30,14 @@ import qualified Network.Wai.Handler.Warp.Timeout as Timeout
30maxTotalHeaderLength :: Int
30maxTotalHeaderLength :: Int
31maxTotalHeaderLength = 50 * 1024
31maxTotalHeaderLength = 50 * 1024
34− :: Connection
33+recvRequest :: Connection
35− -> Timeout.Handle
34+ -> Timeout.Handle
36− -> SockAddr
35+ -> SockAddr
37− -> Source IO ByteString
36+ -> Source IO ByteString
38− -> IO (Request, IO (ResumableSource IO ByteString))
37+ -> IO (Request, IO (ResumableSource IO ByteString))
39−parseRequest conn timeoutHandle remoteHost' src1 = do
38+recvRequest conn timeoutHandle remoteHost' src1 = do
40 (src2, headers') <- src1 $$+ takeHeaders
39 (src2, headers') <- src1 $$+ takeHeaders
41− parseRequest' conn timeoutHandle headers' remoteHost' src2
40+ recvRequest' conn timeoutHandle headers' remoteHost' src2
43handleExpect :: Connection
42handleExpect :: Connection
44 -> H.HttpVersion
43 -> H.HttpVersion
@@ -55,14 +54,14 @@ handleExpect conn hv front (("expect", "100-continue"):rest) = do
55handleExpect conn hv front (x:xs) = handleExpect conn hv (front . (x:)) xs
54handleExpect conn hv front (x:xs) = handleExpect conn hv (front . (x:)) xs
57-- | Parse a set of header lines and body into a 'Request'.
56-- | Parse a set of header lines and body into a 'Request'.
58−parseRequest' :: Connection
57+recvRequest' :: Connection
59− -> Timeout.Handle
58+ -> Timeout.Handle
60− -> [ByteString]
59+ -> [ByteString]
61− -> SockAddr
60+ -> SockAddr
62− -> ResumableSource IO ByteString -- FIXME was buffered
61+ -> ResumableSource IO ByteString -- FIXME was buffered
63− -> IO (Request, IO (ResumableSource IO ByteString))
62+ -> IO (Request, IO (ResumableSource IO ByteString))
64−parseRequest' _ _ [] _ _ = throwIO $ NotEnoughLines []
63+recvRequest' _ _ [] _ _ = throwIO $ NotEnoughLines []
65−parseRequest' conn timeoutHandle (firstLine:otherLines) remoteHost' src = do
64+recvRequest' conn timeoutHandle (firstLine:otherLines) remoteHost' src = do
66 (method, rpath', gets, httpversion) <- parseFirst firstLine
65 (method, rpath', gets, httpversion) <- parseFirst firstLine
68 | S.null rpath' = "/"
67 | S.null rpath' = "/"