tls 1.2.6 → 1.2.7
raw patch · 3 files changed
+11/−3 lines, 3 files
Files
- Network/TLS/Core.hs +5/−2
- Network/TLS/Record/State.hs +5/−0
- tls.cabal +1/−1
Network/TLS/Core.hs view
@@ -72,13 +72,16 @@ recvData :: MonadIO m => Context -> m B.ByteString recvData ctx = liftIO $ do checkValid ctx- E.catchJust (\Error_EOF -> Just ())+ E.catchJust safeHandleError_EOF doRecv (\() -> return B.empty) where doRecv = do pkt <- withReadLock ctx $ recvPacket ctx either onError process pkt-+ + safeHandleError_EOF Error_EOF = Just ()+ safeHandleError_EOF _ = Nothing+ onError err@(Error_Protocol (reason,fatal,desc)) = terminate err (if fatal then AlertLevel_Fatal else AlertLevel_Warning) desc reason onError err =
Network/TLS/Record/State.hs view
@@ -23,6 +23,7 @@ ) where import Data.Word+import Control.Applicative import Control.Monad.State import Control.Monad.Error import Network.TLS.Compression@@ -56,6 +57,10 @@ newtype RecordM a = RecordM { runRecordM :: Version -> RecordState -> Either TLSError (a, RecordState) }++instance Applicative RecordM where+ pure = return+ (<*>) = ap instance Monad RecordM where return a = RecordM $ \_ st -> Right (a, st)
tls.cabal view
@@ -1,5 +1,5 @@ Name: tls-Version: 1.2.6+Version: 1.2.7 Description: Native Haskell TLS and SSL protocol implementation for server and client. .