on master help sign in
just layout.
bfe178eKazu Yamamoto
warp/Network/Wai/Handler/Warp/Request.hs+23−21
@@ -42,30 +42,32 @@ recvRequest :: Connection
42 -> Timeout.Handle
42 -> Timeout.Handle
43 -> SockAddr
43 -> SockAddr
44 -> Source IO ByteString
44 -> Source IO ByteString
45+ -> IO (Request
45− -> IO (Request, IO (ResumableSource IO ByteString))
46+ ,IO (ResumableSource IO ByteString))
46−recvRequest conn timeoutHandle remoteHost' src0 = do
47+recvRequest conn timeoutHandle addr src0 = do
47 (src, hdrlines) <- src0 $$+ headerLines
48 (src, hdrlines) <- src0 $$+ headerLines
48 (method, rpath, gets, httpversion, hdr) <- parseHeaderLines hdrlines
49 (method, rpath, gets, httpversion, hdr) <- parseHeaderLines hdrlines
49 let idxhdr = indexRequestHeader hdr
50 let idxhdr = indexRequestHeader hdr
51+ expect = idxhdr ! idxExpect
52+ cl = idxhdr ! idxContentLength
53+ te = idxhdr ! idxTransferEncoding
50− liftIO $ handleExpect conn httpversion (idxhdr ! idxExpect)
54+ liftIO $ handleExpect conn httpversion expect
51− (rbody, bodyLength, getSource) <- bodyAndSource src
55+ (rbody, bodyLength, getSource) <- bodyAndSource src cl te
52− (idxhdr ! idxContentLength)
53− (idxhdr ! idxTransferEncoding)
54−
55− return (Request
56+ let req = Request {
56− { requestMethod = method
57+ requestMethod = method
57− , httpVersion = httpversion
58+ , httpVersion = httpversion
58− , pathInfo = H.decodePathSegments rpath
59+ , pathInfo = H.decodePathSegments rpath
59− , rawPathInfo = rpath
60+ , rawPathInfo = rpath
60− , rawQueryString = gets
61+ , rawQueryString = gets
61− , queryString = H.parseQuery gets
62+ , queryString = H.parseQuery gets
62− , requestHeaders = hdr
63+ , requestHeaders = hdr
63− , isSecure = False
64+ , isSecure = False
64− , remoteHost = remoteHost'
65+ , remoteHost = addr
65− , requestBody = timeoutBody timeoutHandle rbody
66+ , requestBody = timeoutBody timeoutHandle rbody
66− , vault = mempty
67+ , vault = mempty
67− , requestBodyLength = bodyLength
68+ , requestBodyLength = bodyLength
69+ }
68− }, getSource)
70+ return (req, getSource)
69
71
70----------------------------------------------------------------
72----------------------------------------------------------------
71
73