on master help sign in
Fix warp-tls for new sendfile implementation
commit2095f1cd360379634d15919b8e6ce9c09e17f140 authorMichael Snoyman <michael@snoyman.com> dateFri 22 Jun 2012, 14:07 (14 years ago) parent2011bd0
2 files changed+4−2
warp-tls/Network/Wai/Handler/WarpTLS.hs+3−1 warp/test/main.hs+1−1
warp-tls/Network/Wai/Handler/WarpTLS.hs+3−1
@@ -58,7 +58,9 @@ runTLS tset set app = do
5858 let conn = Connection
5959 { connSendMany = TLS.sendData ctx . L.fromChunks
6060 , connSendAll = TLS.sendData ctx . L.fromChunks . return
61− , connSendFile = \fp offset len _th -> C.runResourceT $ sourceFileRange fp (Just offset) (Just len) C.$$ CL.mapM_ (TLS.sendData ctx . L.fromChunks . return)
61+ , connSendFile = \fp offset len _th headers -> C.runResourceT $ do
62+ TLS.sendData ctx $ L.fromChunks headers
63+ sourceFileRange fp (Just offset) (Just len) C.$$ CL.mapM_ (TLS.sendData ctx . L.fromChunks . return)
6264 , connClose = do
6365 TLS.bye ctx
6466 hClose h
warp/test/main.hs+1−1
@@ -116,7 +116,7 @@ singlePostHello :: ByteString
116116singlePostHello = "POST /hello HTTP/1.1\r\nHost: localhost\r\nContent-length: 5\r\n\r\nHello"
117117
118118main :: IO ()
119−main = hspecX $ do
119+main = hspec $ do
120120 describe "non-pipelining" $ do
121121 it "no body, read" $ runTest 5 readBody $ replicate 5 singleGet
122122 it "no body, ignore" $ runTest 5 ignoreBody $ replicate 5 singleGet