mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-18 02:13:00 +08:00
Change behavior of NoMatchingSubscribers (#1975)
Change behavior of NoMatchingSubscribers.
This commit is contained in:
@@ -257,7 +257,12 @@ namespace MQTTnet.Server
|
||||
|
||||
if (matchingSubscribersCount == 0)
|
||||
{
|
||||
reasonCode = (int)MqttPubAckReasonCode.NoMatchingSubscribers;
|
||||
if (reasonCode == (int)MqttPubAckReasonCode.Success)
|
||||
{
|
||||
// Only change the value if it was success. Otherwise, we would hide an error or not authorized status.
|
||||
reasonCode = (int)MqttPubAckReasonCode.NoMatchingSubscribers;
|
||||
}
|
||||
|
||||
await FireApplicationMessageNotConsumedEvent(applicationMessage, senderId).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user