gsasl 0.3.3 → 0.3.4
raw patch · 2 files changed
+20/−25 lines, 2 filesdep ~basedep ~transformersPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, transformers
API changes (from Hackage documentation)
Files
- gsasl.cabal +4/−4
- lib/Network/Protocol/SASL/GNU.hs +16/−21
gsasl.cabal view
@@ -1,5 +1,5 @@ name: gsasl-version: 0.3.3+version: 0.3.4 license: GPL-3 license-file: license.txt author: John Millikin <jmillikin@gmail.com>@@ -11,7 +11,7 @@ homepage: https://john-millikin.com/software/haskell-gsasl/ bug-reports: mailto:jmillikin@gmail.com -synopsis: Bindings for GNU SASL+synopsis: Bindings for GNU libgsasl description: source-repository head@@ -21,7 +21,7 @@ source-repository this type: bazaar location: https://john-millikin.com/branches/haskell-gsasl/0.3/- tag: haskell-gsasl_0.3.3+ tag: haskell-gsasl_0.3.4 library ghc-options: -Wall -O2@@ -30,7 +30,7 @@ build-depends: base >= 4.0 && < 5.0- , transformers >= 0.2 && < 0.3+ , transformers >= 0.2 , bytestring >= 0.9 && < 0.10 pkgconfig-depends: libgsasl >= 1.1
lib/Network/Protocol/SASL/GNU.hs view
@@ -1,22 +1,21 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE ForeignFunctionInterface #-}+ -- Copyright (C) 2010 John Millikin <jmillikin@gmail.com>--- +-- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- any later version.--- +-- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details.--- +-- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -{-# LANGUAGE ForeignFunctionInterface #-}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE CPP #-} module Network.Protocol.SASL.GNU ( -- * Library Information@@ -77,20 +76,20 @@ -- Imports {{{ -import Prelude hiding (catch)+import Prelude hiding (catch) import qualified Control.Exception as E+import Control.Monad (when, unless)+import Control.Monad.IO.Class (MonadIO, liftIO)+import qualified Control.Monad.Trans.Reader as R import qualified Data.ByteString as B import qualified Data.ByteString.Unsafe as B-import Data.ByteString.Char8 ()-import Data.Char (isDigit)-import Data.Typeable (Typeable)-import Data.String (IsString, fromString)+import qualified Data.ByteString.Char8 as Char8+import Data.Char (isDigit)+import Data.String (IsString, fromString)+import Data.Typeable (Typeable) import qualified Foreign as F import qualified Foreign.C as F-import System.IO.Unsafe (unsafePerformIO)-import Control.Monad (when, unless)-import Control.Monad.IO.Class (MonadIO, liftIO)-import qualified Control.Monad.Trans.Reader as R+import System.IO.Unsafe (unsafePerformIO) import qualified Text.ParserCombinators.ReadP as P -- }}}@@ -125,13 +124,9 @@ Just version -> version Nothing -> error $ "Invalid version string: " ++ show maybeStr -#if MIN_VERSION_base(4,2,0)- eof = P.eof-#else eof = do s <- P.look unless (null s) P.pfail-#endif -- | Whether the header and library versions are compatible checkVersion :: IO Bool@@ -208,7 +203,7 @@ -- no supported 'Mechanism' is found). clientSuggestMechanism :: [Mechanism] -> SASL (Maybe Mechanism) clientSuggestMechanism mechs = do- let bytes = B.intercalate " " [x | Mechanism x <- mechs]+ let bytes = B.intercalate (Char8.pack " ") [x | Mechanism x <- mechs] ctx <- getContext liftIO $ B.useAsCString bytes $ \pMechlist -> gsasl_client_suggest_mechanism ctx pMechlist >>=