mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-15 00:15:15 +08:00
Fix minor bug in MqttV5PacketEncoder.cs (#1939)
* Fix minor bug in MqttV5PacketEncoder.cs * Update ReleaseNotes.md --------- Co-authored-by: Christian <6939810+chkr1011@users.noreply.github.com>
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
|
* [Core] Optimized packet serialization of PUBACK and PUBREC packets for protocol version 5.0.0 (#1939, thanks to @Y-Sindo).
|
||||||
* [Core] The package inspector is now fully async (#1941).
|
* [Core] The package inspector is now fully async (#1941).
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ namespace MQTTnet.Formatter.V5
|
|||||||
_propertiesWriter.WriteReasonString(packet.ReasonString);
|
_propertiesWriter.WriteReasonString(packet.ReasonString);
|
||||||
_propertiesWriter.WriteUserProperties(packet.UserProperties);
|
_propertiesWriter.WriteUserProperties(packet.UserProperties);
|
||||||
|
|
||||||
if (_bufferWriter.Length > 0 || packet.ReasonCode != MqttPubAckReasonCode.Success)
|
if (_propertiesWriter.Length > 0 || packet.ReasonCode != MqttPubAckReasonCode.Success)
|
||||||
{
|
{
|
||||||
_bufferWriter.WriteByte((byte)packet.ReasonCode);
|
_bufferWriter.WriteByte((byte)packet.ReasonCode);
|
||||||
_propertiesWriter.WriteTo(_bufferWriter);
|
_propertiesWriter.WriteTo(_bufferWriter);
|
||||||
@@ -375,7 +375,7 @@ namespace MQTTnet.Formatter.V5
|
|||||||
|
|
||||||
_bufferWriter.WriteTwoByteInteger(packet.PacketIdentifier);
|
_bufferWriter.WriteTwoByteInteger(packet.PacketIdentifier);
|
||||||
|
|
||||||
if (_bufferWriter.Length > 0 || packet.ReasonCode != MqttPubRecReasonCode.Success)
|
if (_propertiesWriter.Length > 0 || packet.ReasonCode != MqttPubRecReasonCode.Success)
|
||||||
{
|
{
|
||||||
_bufferWriter.WriteByte((byte)packet.ReasonCode);
|
_bufferWriter.WriteByte((byte)packet.ReasonCode);
|
||||||
_propertiesWriter.WriteTo(_bufferWriter);
|
_propertiesWriter.WriteTo(_bufferWriter);
|
||||||
@@ -534,4 +534,4 @@ namespace MQTTnet.Formatter.V5
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user