From 72eb1d10f13789bd64e7902b50b3c1d6ee4d0dd2 Mon Sep 17 00:00:00 2001 From: Vincent Hanquez Date: Sun, 26 Jan 2014 07:06:39 +0000 Subject: [PATCH] repair loggin --- core/Tests/Connection.hs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/Tests/Connection.hs b/core/Tests/Connection.hs index dcd7403..7c876ed 100644 --- a/core/Tests/Connection.hs +++ b/core/Tests/Connection.hs @@ -93,9 +93,6 @@ arbitraryPairParams = do secNeg <- arbitrary --- , pLogging = logging "server: " --- , pLogging = logging "client: " - let serverState = def { serverSupported = def { supportedCiphers = serverCiphers , supportedVersions = serAllowedVersions @@ -117,11 +114,6 @@ arbitraryPairParams = do } return (clientState, serverState) where - logging pre = - if debug - then def { loggingPacketSent = putStrLn . ((pre ++ ">> ") ++) - , loggingPacketRecv = putStrLn . ((pre ++ "<< ") ++) } - else def arbitraryCiphers = resize (length knownCiphers + 1) $ listOf1 (elements knownCiphers) setPairParamsSessionManager :: SessionManager -> (ClientParams, ServerParams) -> (ClientParams, ServerParams) @@ -146,7 +138,16 @@ newPairContext pipe (cParams, sParams) = do cCtx' <- contextNew cBackend cParams cRNG sCtx' <- contextNew sBackend sParams sRNG + contextHookSetLogging cCtx' (logging "client: ") + contextHookSetLogging sCtx' (logging "server: ") + return (cCtx', sCtx') + where + logging pre = + if debug + then def { loggingPacketSent = putStrLn . ((pre ++ ">> ") ++) + , loggingPacketRecv = putStrLn . ((pre ++ "<< ") ++) } + else def establishDataPipe params tlsServer tlsClient = do -- initial setup