rename handle to context

This commit is contained in:
Vincent Hanquez 2011-11-14 22:16:52 +00:00
parent 50a1186ab8
commit 88b8da59f0

View file

@ -165,17 +165,17 @@ prop_handshake_initiate = do
someWords8 :: Int -> Gen [Word8] someWords8 :: Int -> Gen [Word8]
someWords8 i = replicateM i (fromIntegral <$> (choose (0,255) :: Gen Int)) someWords8 i = replicateM i (fromIntegral <$> (choose (0,255) :: Gen Int))
tlsServer handle queue = do tlsServer ctx queue = do
success <- handshake handle success <- handshake ctx
unless success $ fail "handshake failed on server side" unless success $ fail "handshake failed on server side"
d <- recvData handle d <- recvData ctx
writeChan queue d writeChan queue d
return () return ()
tlsClient queue handle = do tlsClient queue ctx = do
success <- handshake handle success <- handshake ctx
unless success $ fail "handshake failed on client side" unless success $ fail "handshake failed on client side"
d <- readChan queue d <- readChan queue
sendData handle d sendData ctx d
return () return ()
assertEq expected got = unless (expected == got) $ error ("got " ++ show got ++ " but was expecting " ++ show expected) assertEq expected got = unless (expected == got) $ error ("got " ++ show got ++ " but was expecting " ++ show expected)