on master help sign in
defaultSendFile always uses sendfile.
commitd67fdb89a72b39e0b1eeb168f55ed6b8e821c8b0 authorKazu Yamamoto <kazu@iij.ad.jp> dateFri 12 Jun 2015, 22:57 (11 years ago) parent11fa99b
1 file changed+4−3
warp/Network/Wai/Handler/Warp/SendFile.hs+4−3
warp/Network/Wai/Handler/Warp/SendFile.hs+4−3
@@ -25,12 +25,13 @@ import System.Posix.Types
2525
2626defaultSendFile :: Socket -> Buffer -> BufSize -> (ByteString -> IO ()) -> SendFile
2727#ifdef SENDFILEFD
28−defaultSendFile s buf siz sendall fid off len act hdr = case mfid of
28+defaultSendFile s _ _ _ fid off len act hdr = case mfid of
2929 -- settingsFdCacheDuration is 0
30− Nothing -> readSendFile buf siz sendall fid off len act hdr
31− Just fd -> sendfileFdWithHeader s fd (PartOfFile off len) act hdr
30+ Nothing -> sendfileWithHeader s path (PartOfFile off len) act hdr
31+ Just fd -> sendfileFdWithHeader s fd (PartOfFile off len) act hdr
3232 where
3333 mfid = fileIdFd fid
34+ path = fileIdPath fid
3435#else
3536defaultSendFile _ = readSendFile
3637#endif