packages feed

net-mqtt 0.2.0.0 → 0.2.1.0

raw patch · 3 files changed

+23/−12 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

Changelog.md view
@@ -1,5 +1,13 @@ # Changelog for net-mqtt +## 0.2.1.0++No externally visible changes, but a few bug fixes I found when+writing an application that published in QoS < 2.  QoS 0 would likely+not transmit (which is probably fine according to the spec, but not+very desirable) and QoS1 didn't check its ACKs, so it would continue+to retry after the server ACKd the message.+ ## 0.2.0.0  ### API Change
net-mqtt.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: d216fe9f0aa63caf396fca116a64146457a0c10dbb97ec4935c578e3158115f7+-- hash: a06d7432239129c0c9e1c167ca977a97d9dae67c57e59c8a0a4a8c4985a53905  name:           net-mqtt-version:        0.2.0.0+version:        0.2.1.0 synopsis:       An MQTT Protocol Implementation. description:    Please see the README on GitHub at <https://github.com/dustin/mqtt#readme> category:       Network
src/Network/MQTT/Client.hs view
@@ -301,22 +301,25 @@          -> IO () publishq c t m r q = do   (ch,pid) <- atomically $ reservePktID c types-  E.finally (publishAndWait ch pid) (atomically $ releasePktIDs c [(t',pid) | t' <- types])+  E.finally (publishAndWait ch pid q) (atomically $ releasePktIDs c [(t',pid) | t' <- types])      where-      types = [DPubREC, DPubCOMP]-      publishAndWait ch pid = withAsync (pub False pid) (\p -> satisfyQoS p ch pid)+      types = [DPubACK, DPubREC, DPubCOMP]+      publishAndWait ch pid QoS0 = sendPacketIO c (pkt False pid)+      publishAndWait ch pid _ = withAsync (pub False pid) (\p -> satisfyQoS p ch pid)        pub dup pid = do-        sendPacketIO c (PublishPkt $ PublishRequest {-                           _pubDup = dup,-                           _pubQoS = q,-                           _pubPktID = pid,-                           _pubRetain = r,-                           _pubTopic = textToBL t,-                           _pubBody = m})+        sendPacketIO c (pkt dup pid)         threadDelay 5000000         pub True pid++      pkt dup pid = (PublishPkt $ PublishRequest {+                        _pubDup = dup,+                        _pubQoS = q,+                        _pubPktID = pid,+                        _pubRetain = r,+                        _pubTopic = textToBL t,+                        _pubBody = m})        satisfyQoS p ch pid         | q == QoS0 = pure ()