HsOpenSSL 0.6.3 → 0.6.4
raw patch · 3 files changed
+21/−11 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- HsOpenSSL.cabal +1/−1
- NEWS +11/−0
- OpenSSL/BIO.hsc +9/−10
HsOpenSSL.cabal view
@@ -5,7 +5,7 @@ can generate RSA and DSA keys, read and write PEM files, generate message digests, sign and verify messages, encrypt and decrypt messages.-Version: 0.6.3+Version: 0.6.4 License: PublicDomain License-File: COPYING Author: Adam Langley <agl at imperialviolet.org>, PHO <pho at cielonegro.org>
NEWS view
@@ -1,5 +1,16 @@ -*- Coding: utf-8 -*- +Changes from 0.6.3 to 0.6.4+---------------------------+* Applied a patch by Taru Karttunen:++ > Unbreak BIO ForeignPtrs for GHC 6.10+ >+ > In GHC 6.10 it is no longer possible to mix C and Haskell+ > finalizers on the same ForeignPtr. This patch fixes that+ > and unbreaks things for GHC 6.10.++ Changes from 0.6.2 to 0.6.3 --------------------------- * Suggestion by Grant Monroe:
OpenSSL/BIO.hsc view
@@ -79,7 +79,7 @@ import qualified Data.ByteString.Lazy.Internal as L import Foreign hiding (new) import Foreign.C-import qualified GHC.ForeignPtr as GF+import Foreign.Concurrent as Conc import OpenSSL.Utils import System.IO.Unsafe @@ -94,8 +94,8 @@ foreign import ccall unsafe "BIO_new" _new :: Ptr BIO_METHOD -> IO (Ptr BIO_) -foreign import ccall unsafe "&BIO_free"- _free :: FunPtr (Ptr BIO_ -> IO ())+foreign import ccall unsafe "BIO_free"+ _free :: Ptr BIO_ -> IO () foreign import ccall unsafe "BIO_push" _push :: Ptr BIO_ -> Ptr BIO_ -> IO (Ptr BIO_)@@ -113,7 +113,7 @@ wrapBioPtr :: Ptr BIO_ -> IO BIO-wrapBioPtr bioPtr = newForeignPtr _free bioPtr >>= return . BIO+wrapBioPtr bioPtr = Conc.newForeignPtr bioPtr (_free bioPtr) >>= return . BIO withBioPtr :: BIO -> (Ptr BIO_ -> IO a) -> IO a@@ -151,8 +151,8 @@ = withForeignPtr a $ \ aPtr -> withForeignPtr b $ \ bPtr -> do _push aPtr bPtr- GF.addForeignPtrConcFinalizer a $ touchForeignPtr b- GF.addForeignPtrConcFinalizer b $ touchForeignPtr a+ Conc.addForeignPtrFinalizer a $ touchForeignPtr b+ Conc.addForeignPtrFinalizer b $ touchForeignPtr a return () -- |@a '==>' b@ is an alias to @'bioPush' a b@.@@ -435,8 +435,7 @@ -- |@'newConstMem' str@ creates a read-only memory BIO source. newConstMem :: String -> IO BIO-newConstMem str- = (return . B.pack) str >>= newConstMemBS+newConstMem str = newConstMemBS (B.pack str) -- |@'newConstMemBS' bs@ is like 'newConstMem' but takes a ByteString. newConstMemBS :: B.ByteString -> IO BIO@@ -448,8 +447,8 @@ do bioPtr <- _new_mem_buf (castPtr $ buf `plusPtr` off) (fromIntegral len) >>= failIfNull - bio <- newForeignPtr _free bioPtr- GF.addForeignPtrConcFinalizer bio $ touchForeignPtr foreignBuf+ bio <- newForeignPtr_ bioPtr+ Conc.addForeignPtrFinalizer bio (_free bioPtr >> touchForeignPtr foreignBuf) return $ BIO bio