mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 09:13:02 +08:00
Fix MQTT v5 topic alias forwarding (#2250)
This commit is contained in:
@@ -218,6 +218,8 @@ public sealed class MqttConnectedClient : IDisposable
|
||||
HandleTopicAlias(publishPacket);
|
||||
|
||||
var applicationMessage = MqttApplicationMessageFactory.Create(publishPacket);
|
||||
// Topic aliases are scoped to this network connection and must not be forwarded to other clients.
|
||||
applicationMessage.TopicAlias = 0;
|
||||
|
||||
var dispatchApplicationMessageResult =
|
||||
await _sessionsManager.DispatchApplicationMessage(Id, UserName, Session.Items, applicationMessage, cancellationToken).ConfigureAwait(false);
|
||||
@@ -579,4 +581,4 @@ public sealed class MqttConnectedClient : IDisposable
|
||||
_logger.Warning(exception, "Client '{0}': Error while sending DISCONNECT packet (ReasonCode = {1})", Id, options.ReasonCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user