From: PHO Date: Mon, 17 Oct 2011 14:10:29 +0000 (+0900) Subject: hPutLBS is no longer used. X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=1f3ac4a;p=Lucu.git hPutLBS is no longer used. Ditz-issue: 8959dadc07db1bd363283dee401073f6e48dc7fa --- diff --git a/Network/HTTP/Lucu/HandleLike.hs b/Network/HTTP/Lucu/HandleLike.hs index f38fa5b..c4a4c62 100644 --- a/Network/HTTP/Lucu/HandleLike.hs +++ b/Network/HTTP/Lucu/HandleLike.hs @@ -1,5 +1,6 @@ {-# LANGUAGE - UnicodeSyntax + DoAndIfThenElse + , UnicodeSyntax #-} module Network.HTTP.Lucu.HandleLike ( HandleLike(..) @@ -17,7 +18,6 @@ import qualified System.IO as I class HandleLike h where hGetLBS ∷ h → IO L.ByteString - hPutLBS ∷ h → L.ByteString → IO () hGetBS ∷ h → Int → IO B.ByteString hPutBS ∷ h → B.ByteString → IO () @@ -28,10 +28,8 @@ class HandleLike h where hFlush ∷ h → IO () hClose ∷ h → IO () - instance HandleLike I.Handle where hGetLBS = L.hGetContents - hPutLBS = L.hPut hGetBS = B.hGet hPutBS = B.hPut @@ -39,23 +37,21 @@ instance HandleLike I.Handle where hFlush = I.hFlush hClose = I.hClose - instance HandleLike SSL.SSL where - hGetLBS = SSL.lazyRead - hPutLBS = SSL.lazyWrite + hGetLBS = SSL.lazyRead - hGetBS = SSL.read - hPutBS = SSL.write + hGetBS = SSL.read + hPutBS = SSL.write hGetPeerCert s = do isValid <- SSL.getVerifyResult s if isValid then SSL.getPeerCertificate s - else + else return Nothing - hFlush _ = return () -- No need to do anything. - hClose s = SSL.shutdown s SSL.Bidirectional + hFlush _ = return () -- No need to do anything. + hClose s = SSL.shutdown s SSL.Bidirectional hPutBuilder ∷ HandleLike h ⇒ h → Builder → IO () {-# INLINE hPutBuilder #-}