net-mqtt 0.2.4.1 → 0.2.4.2
raw patch · 3 files changed
+17/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Changelog.md +8/−0
- net-mqtt.cabal +2/−2
- src/Network/MQTT/Client.hs +7/−3
Changelog.md view
@@ -1,5 +1,13 @@ # Changelog for net-mqtt +## 0.2.4.2++Don't set a message ID of 0.++This had been working fine for a while, but starting in mosquitto 1.6,+the server would just hang up on a subscribe request with a message ID+of zero.+ ## 0.2.4.1 Link QoS2 completion thread on subscriber.
net-mqtt.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: dc7e4a1db1c001ec1c63bdbb3da55fd4ff4a6f42aaf09aac10288f50eb11d858+-- hash: 90cb428a2c77b19e3ed4d018bbbcb1db82904497e9599d297097926ab1bfe039 name: net-mqtt-version: 0.2.4.1+version: 0.2.4.2 synopsis: An MQTT Protocol Implementation. description: Please see the README on GitHub at <https://github.com/dustin/mqtt-hs#readme> category: Network
src/Network/MQTT/Client.hs view
@@ -145,7 +145,7 @@ runClientAppData :: ((AppData -> IO ()) -> IO ()) -> MQTTConfig -> IO MQTTClient runClientAppData mkconn MQTTConfig{..} = do ch <- newTChanIO- pid <- newTVarIO 0+ pid <- newTVarIO 1 thr <- newTVarIO [] acks <- newTVarIO mempty st <- newTVarIO Starting@@ -302,7 +302,7 @@ reservePktID MQTTClient{..} dts = do ch <- newTChan pid <- readTVar _pktID- modifyTVar' _pktID succ+ modifyTVar' _pktID (\x -> case succ x of 0 -> 1; x' -> x') modifyTVar' _acks (Map.union (Map.fromList [((t, pid), ch) | t <- dts])) pure (ch,pid) @@ -321,7 +321,11 @@ pure (ch,pid) -- Wait for the response in a separate transaction.- atomically $ releasePktID c (dt,pid) >> readTChan ch+ atomically $ do+ st <- readTVar _st+ when (st /= Connected) $ fail "disconnected waiting for response"+ releasePktID c (dt,pid)+ readTChan ch -- | Subscribe to a list of topic filters with their respective QoSes. -- The accepted QoSes are returned in the same order as requested.