hedis 0.9.8 → 0.9.9
raw patch · 3 files changed
+18/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG +4/−0
- hedis.cabal +1/−1
- src/Database/Redis/ProtocolPipelining.hs +13/−2
CHANGELOG view
@@ -1,5 +1,9 @@ # Changelog for Hedis +## 0.9.9++* PR #90. set SO_KEEPALIVE option on underlying connection socket + ## 0.9.8 * Fix syntax errors from redis when using scanOpts to specify match
hedis.cabal view
@@ -1,5 +1,5 @@ name: hedis-version: 0.9.8+version: 0.9.9 synopsis: Client library for the Redis datastore: supports full command set, pipelining.
src/Database/Redis/ProtocolPipelining.hs view
@@ -28,6 +28,8 @@ import Data.IORef import Data.Typeable import Network+import qualified Network.BSD as BSD+import qualified Network.Socket as NS import System.IO import System.IO.Error import System.IO.Unsafe@@ -53,8 +55,8 @@ instance Exception ConnectionLostException connect :: HostName -> PortID -> IO Connection-connect host port =- bracketOnError (connectTo host port) hClose $ \connHandle -> do+connect hostName (PortNumber port) =+ bracketOnError hConnect hClose $ \connHandle -> do hSetBinaryMode connHandle True connReplies <- newIORef [] connPending <- newIORef []@@ -64,6 +66,15 @@ writeIORef connReplies rs writeIORef connPending rs return conn+ where hConnect =+ bracketOnError mkSocket NS.close $ \sock -> do+ NS.setSocketOption sock NS.KeepAlive 1+ host <- BSD.getHostByName hostName+ NS.connect sock $ NS.SockAddrInet port (BSD.hostAddress host)+ NS.socketToHandle sock ReadWriteMode+ mkSocket = NS.socket NS.AF_INET NS.Stream 0+connect hostName portID =+ error $ "Connection to " ++ hostName ++ ":" ++ show portID ++ " not supported" disconnect :: Connection -> IO () disconnect Conn{..} = do