X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FSocketLike.hs;h=998e4490761bfb6324f6d5bb03a47073ec5c25c4;hb=874e6a4;hp=dd9c34b00fc54935c051e4dd560cc123a7c28402;hpb=3eb69879d3b336c7c3e613c0ce4bfb3c67989ff3;p=Lucu.git diff --git a/Network/HTTP/Lucu/SocketLike.hs b/Network/HTTP/Lucu/SocketLike.hs index dd9c34b..998e449 100644 --- a/Network/HTTP/Lucu/SocketLike.hs +++ b/Network/HTTP/Lucu/SocketLike.hs @@ -1,17 +1,21 @@ {-# LANGUAGE - FlexibleContexts + CPP + , FlexibleContexts , FlexibleInstances , TypeFamilies , UnicodeSyntax #-} +-- |Type class for things behaves like a 'So.Socket'. module Network.HTTP.Lucu.SocketLike ( SocketLike(..) ) where import qualified Network.Socket as So import Network.HTTP.Lucu.HandleLike +#if defined(HAVE_SSL) import qualified OpenSSL.Session as SSL import Prelude.Unicode +#endif import qualified System.IO as I class (HandleLike (Handle s)) ⇒ SocketLike s where @@ -29,6 +33,7 @@ instance SocketLike So.Socket where socketPort = So.socketPort +#if defined(HAVE_SSL) instance SocketLike (SSL.SSLContext, So.Socket) where type Handle (SSL.SSLContext, So.Socket) = SSL.SSL @@ -39,3 +44,4 @@ instance SocketLike (SSL.SSLContext, So.Socket) where return (ssl, addr) socketPort = So.socketPort ∘ snd +#endif