on master help sign in
Merge commit 'bc5e1' into beta
commit2011bd0ab8f1f4eb5ab771e20a397c0b73387458 authorMichael Snoyman <michael@snoyman.com> dateFri 22 Jun 2012, 11:51 (14 years ago) parentc057210bc5e13d
2 files changed+6−7
warp/Network/Wai/Handler/Warp.hs+5−6 warp/warp.cabal+1−1
warp/Network/Wai/Handler/Warp.hs+5−6
@@ -162,7 +162,7 @@ allowInterrupt = unblock $ return ()
162162data Connection = Connection
163163 { connSendMany :: [B.ByteString] -> IO ()
164164 , connSendAll :: B.ByteString -> IO ()
165− , connSendFile :: FilePath -> Integer -> Integer -> IO () -> IO () -- ^ offset, length
165+ , connSendFile :: FilePath -> Integer -> Integer -> IO () -> [ByteString] -> IO () -- ^ offset, length
166166 , connClose :: IO ()
167167 , connRecv :: IO B.ByteString
168168 }
@@ -171,7 +171,7 @@ socketConnection :: Socket -> Connection
171171socketConnection s = Connection
172172 { connSendMany = Sock.sendMany s
173173 , connSendAll = Sock.sendAll s
174− , connSendFile = \fp off len act -> sendfile s fp (PartOfFile off len) act
174+ , connSendFile = \fp off len act hdr -> sendfileWithHeader s fp (PartOfFile off len) act hdr
175175 , connClose = sClose s
176176 , connRecv = Sock.recv s bytesPerRead
177177 }
@@ -584,13 +584,12 @@ sendResponse th req conn r = sendResponse' r
584584 [("Content-Type", "text/plain")]
585585 "File not found"
586586 Right (lengthyHeaders, cl) -> liftIO $ do
587− let headers' = headers version s lengthyHeaders
588− sendHeader $ headers' False
587+ let headers' = L.toChunks . toLazyByteString $ headers version s lengthyHeaders False
589588 T.tickle th
590589 if hasBody s req then do
591590 case mpart of
592− Nothing -> connSendFile conn fp 0 cl (T.tickle th)
593− Just part -> connSendFile conn fp (filePartOffset part) (filePartByteCount part) (T.tickle th)
591+ Nothing -> connSendFile conn fp 0 cl (T.tickle th) headers'
592+ Just part -> connSendFile conn fp (filePartOffset part) (filePartByteCount part) (T.tickle th) headers'
594593 T.tickle th
595594 return isPersist
596595 else
warp/warp.cabal+1−1
@@ -26,7 +26,7 @@ Library
2626 , blaze-builder-conduit >= 0.5 && < 0.6
2727 , lifted-base >= 0.1 && < 0.2
2828 , blaze-builder >= 0.2.1.4 && < 0.4
29− , simple-sendfile >= 0.2.2 && < 0.3
29+ , simple-sendfile >= 0.2.4 && < 0.3
3030 , http-types >= 0.6 && < 0.7
3131 , case-insensitive >= 0.2
3232 , unix-compat >= 0.2