hedis 0.9.10 → 0.9.11
raw patch · 3 files changed
+14/−27 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 +9/−26
CHANGELOG view
@@ -1,5 +1,9 @@ # Changelog for Hedis +## 0.9.11++* PR #94. Refactor fix for issue #92 - (Connection to Unix sockets is broken)+ ## 0.9.10 * PR #93, Issue #92. Connection to Unix sockets is broken
hedis.cabal view
@@ -1,5 +1,5 @@ name: hedis-version: 0.9.10+version: 0.9.11 synopsis: Client library for the Redis datastore: supports full command set, pipelining.
src/Database/Redis/ProtocolPipelining.hs view
@@ -55,26 +55,8 @@ instance Exception ConnectionLostException connect :: HostName -> PortID -> IO Connection-connect hostName (PortNumber port) =- bracketOnError hConnect hClose $ \connHandle -> do- hSetBinaryMode connHandle True- connReplies <- newIORef []- connPending <- newIORef []- connPendingCnt <- newIORef 0- let conn = Conn{..}- rs <- connGetReplies conn- 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 (UnixSocket fsplace) =- bracketOnError hConnect hClose $ \connHandle -> do+connect hostName portID =+ bracketOnError (hConnect portID) hClose $ \connHandle -> do hSetBinaryMode connHandle True connReplies <- newIORef [] connPending <- newIORef []@@ -84,13 +66,14 @@ writeIORef connReplies rs writeIORef connPending rs return conn- where hConnect =+ where hConnect (PortNumber port) = bracketOnError mkSocket NS.close $ \sock -> do- NS.connect sock $ NS.SockAddrUnix fsplace- NS.socketToHandle sock ReadWriteMode- mkSocket = NS.socket NS.AF_UNIX NS.Stream 0-connect hostName portID =- error $ "Connection to " ++ hostName ++ ":" ++ show portID ++ " not supported"+ NS.setSocketOption sock NS.KeepAlive 1+ host <- BSD.getHostByName hostName+ NS.connect sock $ NS.SockAddrInet port (BSD.hostAddress host)+ NS.socketToHandle sock ReadWriteMode+ hConnect _ = connectTo hostName portID+ mkSocket = NS.socket NS.AF_INET NS.Stream 0 disconnect :: Connection -> IO () disconnect Conn{..} = do