@@ -36,18 +36,18 @@ import Numeric (showInt)
36----------------------------------------------------------------
36----------------------------------------------------------------
38sendResponse :: Settings
38sendResponse :: Settings
39− -> Cleaner -> Request -> Connection
39+ -> InternalInfo -> Request -> Connection
40 -> (forall a. IO a -> IO a) -- ^ restore masking state
40 -> (forall a. IO a -> IO a) -- ^ restore masking state
41 -> Response
41 -> Response
42 -> IO Bool
42 -> IO Bool
44----------------------------------------------------------------
44----------------------------------------------------------------
46−sendResponse settings cleaner req conn restore (ResponseFile s0 hs0 path mpart0) =
46+sendResponse settings ii req conn restore (ResponseFile s0 hs0 path mpart0) =
47 restore $ headerAndLength >>= sendResponse'
47 restore $ headerAndLength >>= sendResponse'
49 hs = addAccept hs0
49 hs = addAccept hs0
50− th = threadHandle cleaner
50+ th = threadHandle ii
51 headerAndLength = liftIO . try $ do
51 headerAndLength = liftIO . try $ do
52 (hadLength, cl) <-
52 (hadLength, cl) <-
53 case readInt <$> checkLength hs of
53 case readInt <$> checkLength hs of
@@ -98,13 +98,13 @@ sendResponse settings cleaner req conn restore (ResponseFile s0 hs0 path mpart0)
98 (isPersist,_) = infoFromRequest req
98 (isPersist,_) = infoFromRequest req
100 sendResponse' (Left (_ :: SomeException)) =
100 sendResponse' (Left (_ :: SomeException)) =
101− sendResponse settings cleaner req conn restore notFound
101+ sendResponse settings ii req conn restore notFound
103 notFound = responseLBS H.status404 [(H.hContentType, "text/plain")] "File not found"
103 notFound = responseLBS H.status404 [(H.hContentType, "text/plain")] "File not found"
105----------------------------------------------------------------
105----------------------------------------------------------------
107−sendResponse settings cleaner req conn restore (ResponseBuilder s hs b)
107+sendResponse settings ii req conn restore (ResponseBuilder s hs b)
108 | hasBody s req = restore $ do
108 | hasBody s req = restore $ do
109 header <- composeHeaderBuilder settings version s hs needsChunked
109 header <- composeHeaderBuilder settings version s hs needsChunked
@@ -120,14 +120,14 @@ sendResponse settings cleaner req conn restore (ResponseBuilder s hs b)
120 T.tickle th
120 T.tickle th
121 return isPersist
121 return isPersist
123− th = threadHandle cleaner
123+ th = threadHandle ii
124 version = httpVersion req
124 version = httpVersion req
125 reqinfo@(isPersist,_) = infoFromRequest req
125 reqinfo@(isPersist,_) = infoFromRequest req
126 (isKeepAlive, needsChunked) = infoFromResponse hs reqinfo
126 (isKeepAlive, needsChunked) = infoFromResponse hs reqinfo
128----------------------------------------------------------------
128----------------------------------------------------------------
130−sendResponse settings cleaner req conn restore (ResponseSource s hs withBodyFlush)
130+sendResponse settings ii req conn restore (ResponseSource s hs withBodyFlush)
131 | hasBody s req = withBodyFlush $ \bodyFlush -> restore $ do
131 | hasBody s req = withBodyFlush $ \bodyFlush -> restore $ do
132 header <- liftIO $ composeHeaderBuilder settings version s hs needsChunked
132 header <- liftIO $ composeHeaderBuilder settings version s hs needsChunked
133 let src = CL.sourceList [header] `mappend` cbody bodyFlush
133 let src = CL.sourceList [header] `mappend` cbody bodyFlush
@@ -138,7 +138,7 @@ sendResponse settings cleaner req conn restore (ResponseSource s hs withBodyFlus
138 T.tickle th
138 T.tickle th
139 return isPersist
139 return isPersist
141− th = threadHandle cleaner
141+ th = threadHandle ii
142 cbody bodyFlush =
142 cbody bodyFlush =
143 if needsChunked then body $= chunk else body
143 if needsChunked then body $= chunk else body