@@ -410,15 +410,14 @@ spec = do
410 atomically $ modifyTVar countVar (+ 1)
410 atomically $ modifyTVar countVar (+ 1)
413− withApp defaultSettings app $ \port -> do
413+ withApp defaultSettings app $ withMySocket $ \ms -> do
414− (sock, _addr) <- getSocketTCP "127.0.0.1" port
415− sendAll sock "POST / HTTP/1.1\r\ntransfer-encoding: chunked\r\n\r\n"
414+ msWrite ms "POST / HTTP/1.1\r\ntransfer-encoding: chunked\r\n\r\n"
416 threadDelay 10000
415 threadDelay 10000
417− sendAll sock "5\r\nhello\r\n0\r\n\r\n"
416+ msWrite ms "5\r\nhello\r\n0\r\n\r\n"
418 atomically $ do
417 atomically $ do
419 count <- readTVar countVar
418 count <- readTVar countVar
420 check $ count >= 1
419 check $ count >= 1
421− bs <- safeRecv sock 4096
420+ bs <- safeRecv (msSocket ms) 4096 -- must not use msRead
422 S.takeWhile (/= 13) bs `shouldBe` "HTTP/1.1 200 OK"
421 S.takeWhile (/= 13) bs `shouldBe` "HTTP/1.1 200 OK"
424 it "streaming response with length" $ do
423 it "streaming response with length" $ do