on master help sign in
just layout.
commitbfe178e885c185fbaa4cc56b98bd8bc7480c26cd authorKazu Yamamoto <kazu@iij.ad.jp> dateTue 29 Oct 2013, 20:28 (13 years ago) parentba3e2eb
1 file changed+23−21
warp/Network/Wai/Handler/Warp/Request.hs+23−21
warp/Network/Wai/Handler/Warp/Request.hs+23−21
@@ -42,30 +42,32 @@ recvRequest :: Connection
4242 -> Timeout.Handle
4343 -> SockAddr
4444 -> Source IO ByteString
45− -> IO (Request, IO (ResumableSource IO ByteString))
46−recvRequest conn timeoutHandle remoteHost' src0 = do
45+ -> IO (Request
46+ ,IO (ResumableSource IO ByteString))
47+recvRequest conn timeoutHandle addr src0 = do
4748 (src, hdrlines) <- src0 $$+ headerLines
4849 (method, rpath, gets, httpversion, hdr) <- parseHeaderLines hdrlines
4950 let idxhdr = indexRequestHeader hdr
50− liftIO $ handleExpect conn httpversion (idxhdr ! idxExpect)
51− (rbody, bodyLength, getSource) <- bodyAndSource src
52− (idxhdr ! idxContentLength)
53− (idxhdr ! idxTransferEncoding)
54−
55− return (Request
56− { requestMethod = method
57− , httpVersion = httpversion
58− , pathInfo = H.decodePathSegments rpath
59− , rawPathInfo = rpath
60− , rawQueryString = gets
61− , queryString = H.parseQuery gets
62− , requestHeaders = hdr
63− , isSecure = False
64− , remoteHost = remoteHost'
65− , requestBody = timeoutBody timeoutHandle rbody
66− , vault = mempty
67− , requestBodyLength = bodyLength
68− }, getSource)
51+ expect = idxhdr ! idxExpect
52+ cl = idxhdr ! idxContentLength
53+ te = idxhdr ! idxTransferEncoding
54+ liftIO $ handleExpect conn httpversion expect
55+ (rbody, bodyLength, getSource) <- bodyAndSource src cl te
56+ let req = Request {
57+ requestMethod = method
58+ , httpVersion = httpversion
59+ , pathInfo = H.decodePathSegments rpath
60+ , rawPathInfo = rpath
61+ , rawQueryString = gets
62+ , queryString = H.parseQuery gets
63+ , requestHeaders = hdr
64+ , isSecure = False
65+ , remoteHost = addr
66+ , requestBody = timeoutBody timeoutHandle rbody
67+ , vault = mempty
68+ , requestBodyLength = bodyLength
69+ }
70+ return (req, getSource)
6971
7072----------------------------------------------------------------
7173