From c7b7b55ecb0a51fde179d8124fed76b899b9a8e9 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 26 Feb 2012 14:14:54 +0100 Subject: Updated for the latest hs-tls api. --- Hsbot/Core.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Hsbot/Core.hs b/Hsbot/Core.hs index 670afa0..89f4471 100644 --- a/Hsbot/Core.hs +++ b/Hsbot/Core.hs @@ -41,8 +41,7 @@ initHsbot config = do tlsenv <- initTLSEnv (configTLS config) randomGen <- newGenIO :: IO SystemRandom sCtx <- client tlsenv randomGen connhdl - success <- handshake sCtx - unless success $ errorM "Hsbot.Core" "TLS handshake failed" -- TODO: do some usefull error handling + handshake sCtx return (Just tlsenv, Just sCtx)) else return (Nothing, Nothing) return BotEnv { envBotState = botState @@ -135,7 +134,7 @@ botReader env handle mctx chan = do writeChan chan $ IncomingMsg msg Nothing -> return () readThis :: Handle -> Maybe (TLSCtx Handle) -> IO String - readThis _ (Just ctx) = fmap L.toString (recvData ctx) + readThis _ (Just ctx) = fmap L.toString (recvData' ctx) readThis h Nothing = hGetLine h >>= \s -> return $ s ++ "\n" botLoop :: Env IO () -- cgit v1.2.3