Permalink
Browse files

OpenSSL.Session: SSL, SSLContext, SSLResult, ShutdownType and Verific…

…ationMode are now instances of Typeable.
  • Loading branch information...
1 parent fdff079 commit 451b347128a10710230dbd37f3f20802120ed006 @depressed-pho depressed-pho committed Dec 22, 2011
Showing with 13 additions and 3 deletions.
  1. +1 −1 GNUmakefile
  2. +7 −0 NEWS
  3. +5 −2 OpenSSL/Session.hsc
View
@@ -1,5 +1,5 @@
RUN_COMMAND = $(MAKE) -C examples run
-CONFIGURE_ARGS = --disable-optimization --extra-include-dirs=/usr/pkg/include --extra-lib-dirs=/usr/pkg/lib
+CONFIGURE_ARGS = -O2 -p --extra-include-dirs=/usr/pkg/include --extra-lib-dirs=/usr/pkg/lib
include cabal-package.mk
View
7 NEWS
@@ -1,5 +1,12 @@
-*- coding: utf-8 -*-
+Changes from 0.10.1.2 to (unreleased)
+-------------------------------------
+* OpenSSL.Session:
+ - SSL, SSLContext, SSLResult, ShutdownType and VerificationMode are
+ now instances of Typeable.
+
+
Changes from 0.10.1.1 to 0.10.1.2
---------------------------------
* Applied a patch by Mikhail Vorozhtsov:
View
@@ -102,6 +102,7 @@ data SSLContext = SSLContext { ctxSem :: QSem
, ctxPtr :: ForeignPtr SSLContext_
, ctxVfCb :: IORef (Maybe (FunPtr VerifyCb))
}
+ deriving Typeable
data SSLMethod_
@@ -212,6 +213,7 @@ data VerificationMode = VerifyNone
, vpClientOnce :: Bool -- ^ only request once per connection
, vpCallback :: Maybe (Bool -> X509StoreCtx -> IO Bool) -- ^ optional callback
}
+ deriving Typeable
foreign import ccall unsafe "SSL_CTX_set_verify"
_ssl_set_verify_mode :: Ptr SSLContext_ -> CInt -> FunPtr VerifyCb -> IO ()
@@ -286,6 +288,7 @@ data SSL = SSL { sslSem :: QSem
, sslFd :: Fd -- ^ Get the underlying socket Fd
, sslSocket :: Maybe Socket -- ^ Get the socket underlying an SSL connection
}
+ deriving Typeable
foreign import ccall unsafe "SSL_new" _ssl_new :: Ptr SSLContext_ -> IO (Ptr SSL_)
foreign import ccall unsafe "&SSL_free" _ssl_free :: FunPtr (Ptr SSL_ -> IO ())
@@ -342,7 +345,7 @@ throwSSLException loc ret
data SSLResult a = SSLDone a -- ^ operation finished successfully
| WantRead -- ^ needs more data from the network
| WantWrite -- ^ needs more outgoing buffer space
- deriving (Eq, Show, Functor, Foldable, Traversable)
+ deriving (Eq, Show, Functor, Foldable, Traversable, Typeable)
-- | Block until the operation is finished.
sslBlock :: (SSL -> IO (SSLResult a)) -> SSL -> IO a
@@ -490,7 +493,7 @@ foreign import ccall "SSL_shutdown" _ssl_shutdown :: Ptr SSL_ -> IO CInt
data ShutdownType = Bidirectional -- ^ wait for the peer to also shutdown
| Unidirectional -- ^ only send our shutdown
- deriving (Eq, Show)
+ deriving (Eq, Show, Typeable)
-- | Cleanly shutdown an SSL connection. Note that SSL has a concept of a
-- secure shutdown, which is distinct from just closing the TCP connection.

0 comments on commit 451b347

Please sign in to comment.