@@ -410,15 +410,14 @@ spec = do
410410 atomically $ modifyTVar countVar (+ 1)
411411 loop
412412 loop
413− withApp defaultSettings app $ \port -> 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"
413+ withApp defaultSettings app $ withMySocket $ \ms -> do
414+ msWrite ms "POST / HTTP/1.1\r\ntransfer-encoding: chunked\r\n\r\n"
416415 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"
418417 atomically $ do
419418 count <- readTVar countVar
420419 check $ count >= 1
421− bs <- safeRecv sock 4096
420+ bs <- safeRecv (msSocket ms) 4096 -- must not use msRead
422421 S.takeWhile (/= 13) bs `shouldBe` "HTTP/1.1 200 OK"
423422
424423 it "streaming response with length" $ do