diff options
author | Julien Dessaux | 2012-02-26 14:14:54 +0100 |
---|---|---|
committer | Julien Dessaux | 2012-02-26 14:14:54 +0100 |
commit | c7b7b55ecb0a51fde179d8124fed76b899b9a8e9 (patch) | |
tree | 8eac5d6874c9a3e28349ffc34d61813204284e12 | |
parent | Temporary fix for the parsing mistake when not using TLS (diff) | |
download | hsbot-c7b7b55ecb0a51fde179d8124fed76b899b9a8e9.tar.gz hsbot-c7b7b55ecb0a51fde179d8124fed76b899b9a8e9.tar.bz2 hsbot-c7b7b55ecb0a51fde179d8124fed76b899b9a8e9.zip |
Updated for the latest hs-tls api.
-rw-r--r-- | Hsbot/Core.hs | 5 |
1 files 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 () |