Skip to content

Commit

Permalink
Fix warp-tls for new sendfile implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Jun 22, 2012
1 parent 2011bd0 commit 2095f1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion warp-tls/Network/Wai/Handler/WarpTLS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ runTLS tset set app = do
let conn = Connection
{ connSendMany = TLS.sendData ctx . L.fromChunks
, connSendAll = TLS.sendData ctx . L.fromChunks . return
, connSendFile = \fp offset len _th -> C.runResourceT $ sourceFileRange fp (Just offset) (Just len) C.$$ CL.mapM_ (TLS.sendData ctx . L.fromChunks . return)
, connSendFile = \fp offset len _th headers -> C.runResourceT $ do
TLS.sendData ctx $ L.fromChunks headers
sourceFileRange fp (Just offset) (Just len) C.$$ CL.mapM_ (TLS.sendData ctx . L.fromChunks . return)
, connClose = do
TLS.bye ctx
hClose h
Expand Down
2 changes: 1 addition & 1 deletion warp/test/main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ singlePostHello :: ByteString
singlePostHello = "POST /hello HTTP/1.1\r\nHost: localhost\r\nContent-length: 5\r\n\r\nHello"

main :: IO ()
main = hspecX $ do
main = hspec $ do
describe "non-pipelining" $ do
it "no body, read" $ runTest 5 readBody $ replicate 5 singleGet
it "no body, ignore" $ runTest 5 ignoreBody $ replicate 5 singleGet
Expand Down

0 comments on commit 2095f1c

Please sign in to comment.