on master help sign in
passing T.tickle to sendfile.
commit3b1063d5a723a7f5e7d4fc1cee99351e363366cc authorKazu Yamamoto <kazu@iij.ad.jp> dateWed 22 Jun 2011, 15:50 (15 years ago) parentfd73ffb
1 file changed+4−3
Network/Wai/Handler/Warp.hs+4−3
Network/Wai/Handler/Warp.hs+4−3
@@ -295,16 +295,17 @@ hasBody s req = s /= (H.Status 204 "") && requestMethod req /= "HEAD"
295295
296296sendResponse :: T.Handle
297297 -> Request -> H.HttpVersion -> Socket -> Response -> IO Bool
298−sendResponse _ req hv socket (ResponseFile s hs fp mpart) = do
298+sendResponse th req hv socket (ResponseFile s hs fp mpart) = do
299299 Sock.sendMany socket $ L.toChunks $ toLazyByteString $ headers hv s hs False
300300 if hasBody s req
301301 then do
302302 case mpart of
303− Nothing -> sendfile socket fp EntireFile
303+ Nothing -> sendfile socket fp EntireFile (T.tickle th)
304304 Just part -> sendfile socket fp PartOfFile {
305305 rangeOffset = filePartOffset part
306306 , rangeLength = filePartByteCount part
307− }
307+ } (T.tickle th)
308+ T.tickle th
308309 return $ lookup "content-length" hs /= Nothing
309310 else return True
310311sendResponse th req hv socket (ResponseBuilder s hs b)