mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-30 18:56:30 +08:00
Removed checks for user properties in MQTT v3 and instead ignore them.
This commit is contained in:
@@ -20,11 +20,6 @@ namespace MQTTnet.Formatter.V3
|
|||||||
{
|
{
|
||||||
if (applicationMessage == null) throw new ArgumentNullException(nameof(applicationMessage));
|
if (applicationMessage == null) throw new ArgumentNullException(nameof(applicationMessage));
|
||||||
|
|
||||||
if (applicationMessage.UserProperties?.Any() == true)
|
|
||||||
{
|
|
||||||
throw new MqttProtocolViolationException("User properties are not supported in MQTT version 3.");
|
|
||||||
}
|
|
||||||
|
|
||||||
return new MqttPublishPacket
|
return new MqttPublishPacket
|
||||||
{
|
{
|
||||||
Topic = applicationMessage.Topic,
|
Topic = applicationMessage.Topic,
|
||||||
@@ -171,11 +166,6 @@ namespace MQTTnet.Formatter.V3
|
|||||||
{
|
{
|
||||||
if (options == null) throw new ArgumentNullException(nameof(options));
|
if (options == null) throw new ArgumentNullException(nameof(options));
|
||||||
|
|
||||||
if (options.UserProperties?.Any() == true)
|
|
||||||
{
|
|
||||||
throw new MqttProtocolViolationException("User properties are not supported in MQTT version 3.");
|
|
||||||
}
|
|
||||||
|
|
||||||
var subscribePacket = new MqttSubscribePacket();
|
var subscribePacket = new MqttSubscribePacket();
|
||||||
subscribePacket.TopicFilters.AddRange(options.TopicFilters);
|
subscribePacket.TopicFilters.AddRange(options.TopicFilters);
|
||||||
|
|
||||||
@@ -186,11 +176,6 @@ namespace MQTTnet.Formatter.V3
|
|||||||
{
|
{
|
||||||
if (options == null) throw new ArgumentNullException(nameof(options));
|
if (options == null) throw new ArgumentNullException(nameof(options));
|
||||||
|
|
||||||
if (options.UserProperties?.Any() == true)
|
|
||||||
{
|
|
||||||
throw new MqttProtocolViolationException("User properties are not supported in MQTT version 3.");
|
|
||||||
}
|
|
||||||
|
|
||||||
var unsubscribePacket = new MqttUnsubscribePacket();
|
var unsubscribePacket = new MqttUnsubscribePacket();
|
||||||
unsubscribePacket.TopicFilters.AddRange(options.TopicFilters);
|
unsubscribePacket.TopicFilters.AddRange(options.TopicFilters);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user