on master help sign in
s/parseRequest/recvRequest/
d53c999Kazu Yamamoto
warp/Network/Wai/Handler/Warp.hs+1−1
@@ -52,7 +52,7 @@ module Network.Wai.Handler.Warp (
52 -- ** Data types
52 -- ** Data types
53 , InternalInfo
53 , InternalInfo
54 -- ** Request and response
54 -- ** Request and response
55− , parseRequest
55+ , recvRequest
56 , sendResponse
56 , sendResponse
57#if TEST
57#if TEST
58 , takeHeaders
58 , takeHeaders
warp/Network/Wai/Handler/Warp/Request.hs+15−16
@@ -30,15 +30,14 @@ import qualified Network.Wai.Handler.Warp.Timeout as Timeout
30maxTotalHeaderLength :: Int
30maxTotalHeaderLength :: Int
31maxTotalHeaderLength = 50 * 1024
31maxTotalHeaderLength = 50 * 1024
32
32
33−parseRequest
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
42
41
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
56
55
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
67 let rpath
66 let rpath
68 | S.null rpath' = "/"
67 | S.null rpath' = "/"
warp/Network/Wai/Handler/Warp/Run.hs+1−1
@@ -224,7 +224,7 @@ serveConnection timeoutHandle settings ii app conn remoteHost' =
224 internalError = responseLBS H.internalServerError500 [(H.hContentType, "text/plain")] "Something went wrong"
224 internalError = responseLBS H.internalServerError500 [(H.hContentType, "text/plain")] "Something went wrong"
225
225
226 serveConnection'' fromClient = do
226 serveConnection'' fromClient = do
227− (env, getSource) <- parseRequest conn timeoutHandle remoteHost' fromClient
227+ (env, getSource) <- recvRequest conn timeoutHandle remoteHost' fromClient
228 case settingsIntercept settings env of
228 case settingsIntercept settings env of
229 Nothing -> do
229 Nothing -> do
230 -- Let the application run for as long as it wants
230 -- Let the application run for as long as it wants