Made deliveryCount a local variable.

This commit is contained in:
SeppPenner
2020-06-11 12:39:56 +02:00
parent 7cf12dc751
commit a407fc381b
3 changed files with 4 additions and 6 deletions
-2
View File
@@ -29,7 +29,5 @@ namespace MQTTnet
public byte[] CorrelationData { get; set; }
public List<uint> SubscriptionIdentifiers { get; set; }
internal uint DeliveryCount { get; set; }
}
}
@@ -56,8 +56,6 @@ namespace MQTTnet.Server
_logger.Verbose("Queued application message with topic '{0}' (ClientId: {1}).", applicationMessage.Topic, ClientId);
applicationMessage.DeliveryCount++;
ApplicationMessagesQueue.Enqueue(applicationMessage, senderClientId, checkSubscriptionsResult.QualityOfServiceLevel, isRetainedApplicationMessage);
}
@@ -224,7 +224,7 @@ namespace MQTTnet.Server
await _retainedMessagesManager.HandleMessageAsync(sender?.ClientId, applicationMessage).ConfigureAwait(false);
}
applicationMessage.DeliveryCount = 0;
var deliveryCount = 0;
foreach (var clientSession in _sessions.Values)
{
@@ -232,9 +232,11 @@ namespace MQTTnet.Server
applicationMessage,
sender?.ClientId,
false);
deliveryCount++;
}
if (applicationMessage.DeliveryCount == 0)
if (deliveryCount == 0)
{
if (_options.UndeliveredMessageInterceptor == null)
{