on master help sign in
s/parseRequest/recvRequest/

syncing with sendResponse.

commitd53c9990993dc3623a71d8b1233e515c9e2543f8 authorKazu Yamamoto <kazu@iij.ad.jp> dateMon 28 Oct 2013, 14:57 (13 years ago) parentde0f05a
3 files changed+17−18
warp/Network/Wai/Handler/Warp.hs+1−1 warp/Network/Wai/Handler/Warp/Request.hs+15−16 warp/Network/Wai/Handler/Warp/Run.hs+1−1
warp/Network/Wai/Handler/Warp.hs+1−1
@@ -52,7 +52,7 @@ module Network.Wai.Handler.Warp (
5252 -- ** Data types
5353 , InternalInfo
5454 -- ** Request and response
55− , parseRequest
55+ , recvRequest
5656 , sendResponse
5757#if TEST
5858 , takeHeaders
warp/Network/Wai/Handler/Warp/Request.hs+15−16
@@ -30,15 +30,14 @@ import qualified Network.Wai.Handler.Warp.Timeout as Timeout
3030maxTotalHeaderLength :: Int
3131maxTotalHeaderLength = 50 * 1024
3232
33−parseRequest
34− :: Connection
35− -> Timeout.Handle
36− -> SockAddr
37− -> Source IO ByteString
38− -> IO (Request, IO (ResumableSource IO ByteString))
39−parseRequest conn timeoutHandle remoteHost' src1 = do
33+recvRequest :: Connection
34+ -> Timeout.Handle
35+ -> SockAddr
36+ -> Source IO ByteString
37+ -> IO (Request, IO (ResumableSource IO ByteString))
38+recvRequest conn timeoutHandle remoteHost' src1 = do
4039 (src2, headers') <- src1 $$+ takeHeaders
41− parseRequest' conn timeoutHandle headers' remoteHost' src2
40+ recvRequest' conn timeoutHandle headers' remoteHost' src2
4241
4342handleExpect :: Connection
4443 -> H.HttpVersion
@@ -55,14 +54,14 @@ handleExpect conn hv front (("expect", "100-continue"):rest) = do
5554handleExpect conn hv front (x:xs) = handleExpect conn hv (front . (x:)) xs
5655
5756-- | Parse a set of header lines and body into a 'Request'.
58−parseRequest' :: Connection
59− -> Timeout.Handle
60− -> [ByteString]
61− -> SockAddr
62− -> ResumableSource IO ByteString -- FIXME was buffered
63− -> IO (Request, IO (ResumableSource IO ByteString))
64−parseRequest' _ _ [] _ _ = throwIO $ NotEnoughLines []
65−parseRequest' conn timeoutHandle (firstLine:otherLines) remoteHost' src = do
57+recvRequest' :: Connection
58+ -> Timeout.Handle
59+ -> [ByteString]
60+ -> SockAddr
61+ -> ResumableSource IO ByteString -- FIXME was buffered
62+ -> IO (Request, IO (ResumableSource IO ByteString))
63+recvRequest' _ _ [] _ _ = throwIO $ NotEnoughLines []
64+recvRequest' conn timeoutHandle (firstLine:otherLines) remoteHost' src = do
6665 (method, rpath', gets, httpversion) <- parseFirst firstLine
6766 let rpath
6867 | S.null rpath' = "/"
warp/Network/Wai/Handler/Warp/Run.hs+1−1
@@ -224,7 +224,7 @@ serveConnection timeoutHandle settings ii app conn remoteHost' =
224224 internalError = responseLBS H.internalServerError500 [(H.hContentType, "text/plain")] "Something went wrong"
225225
226226 serveConnection'' fromClient = do
227− (env, getSource) <- parseRequest conn timeoutHandle remoteHost' fromClient
227+ (env, getSource) <- recvRequest conn timeoutHandle remoteHost' fromClient
228228 case settingsIntercept settings env of
229229 Nothing -> do
230230 -- Let the application run for as long as it wants