mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 17:23:04 +08:00
Add UnitTests.
This commit is contained in:
@@ -216,7 +216,7 @@ namespace MQTTnet.Formatter.V3
|
||||
|
||||
return new MqttClientPublishResult
|
||||
{
|
||||
PacketIdentifier = pubRecPacket.PacketIdentifier,
|
||||
PacketIdentifier = pubCompPacket.PacketIdentifier,
|
||||
ReasonCode = MqttClientPublishReasonCode.Success
|
||||
};
|
||||
}
|
||||
|
||||
@@ -61,8 +61,9 @@ namespace MQTTnet.Server
|
||||
using (await _messagesLock.WaitAsync().ConfigureAwait(false))
|
||||
{
|
||||
var saveIsRequired = false;
|
||||
var hasPayload = applicationMessage.Payload?.Any() == true;
|
||||
|
||||
if (applicationMessage.Payload?.Any() != true)
|
||||
if (!hasPayload)
|
||||
{
|
||||
saveIsRequired = _messages.Remove(applicationMessage.Topic);
|
||||
_logger.Verbose("Client '{0}' cleared retained message for topic '{1}'.", clientId, applicationMessage.Topic);
|
||||
|
||||
Reference in New Issue
Block a user