提交 29b8896c 编写于 作者: P Pierre Fersing

Merge branch 'fixes' into develop

......@@ -341,6 +341,16 @@ class MQTTMessage(object):
self.retain = False
self.info = MQTTMessageInfo(mid)
def __eq__(self, other):
"""Override the default Equals behavior"""
if isinstance(other, self.__class__):
return self.mid == other.mid
return False
def __ne__(self, other):
"""Define a non-equality test"""
return not self.__eq__(other)
@property
def topic(self):
if sys.version_info[0] >= 3:
......@@ -2453,7 +2463,8 @@ class Client(object):
rc = self._send_pubrec(message.mid)
message.state = mqtt_ms_wait_for_pubrel
with self._in_message_mutex:
self._in_messages.append(message)
if message not in self._in_messages:
self._in_messages.append(message)
return rc
else:
return MQTT_ERR_PROTOCOL
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册