提交 0eb5e1f1 编写于 作者: R Roger Light

- Fix connecting with MQTT v5 to a broker that doesn't support MQTT v5.

Closes #566. Thanks to Cody Scott.
上级 8fd17b67
......@@ -26,6 +26,8 @@ v1.6.0 - 2021-xx-xx
call the MQTT v5 callback. Closes #570.
- Big performance improvement when receiving large payloads, particularly for
SSL. Closes #571,
- Fix connecting with MQTT v5 to a broker that doesn't support MQTT v5.
Closes #566.
v1.5.1 - 2020-09-22
......
......@@ -3041,9 +3041,15 @@ class Client(object):
if self._protocol == MQTTv5:
(flags, result) = struct.unpack(
"!BB", self._in_packet['packet'][:2])
reason = ReasonCodes(CONNACK >> 4, identifier=result)
properties = Properties(CONNACK >> 4)
properties.unpack(self._in_packet['packet'][2:])
if result == 1:
# This is probably a failure from a broker that doesn't support
# MQTT v5.
reason = 132 # Unsupported protocol version
properties = None
else:
reason = ReasonCodes(CONNACK >> 4, identifier=result)
properties = Properties(CONNACK >> 4)
properties.unpack(self._in_packet['packet'][2:])
else:
(flags, result) = struct.unpack("!BB", self._in_packet['packet'])
if self._protocol == MQTTv311:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册