Pārlūkot izejas kodu

Merge pull request #744 from JanEggers/pr/fix#743

fixed #743
release/3.x.x
Christian pirms 5 gadiem
committed by GitHub
vecāks
revīzija
22aedcba09
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 4AEE18F83AFDEB23
3 mainītis faili ar 22 papildinājumiem un 1 dzēšanām
  1. +1
    -0
      Build/MQTTnet.nuspec
  2. +0
    -1
      Source/MQTTnet.AspnetCore/SpanBasedMqttPacketWriter.cs
  3. +21
    -0
      Tests/MQTTnet.Core.Tests/MqttPacketSerializer_Tests.cs

+ 1
- 0
Build/MQTTnet.nuspec Parādīt failu

@@ -17,6 +17,7 @@
* [Server] Refactoring of server certificate password classes (BREAKING CHANGE!).
* [Server] Fixed an issue with empty server certificate passwords (thanks to @SeppPenner).
* [MQTTnet.Server] Added support for certificate passwords (BREAKING CHANGE IN CONFIG!)
* [MQTTnet.AspNetCore] fixed an issue with mqtt V5 package serialization (#743)
</releaseNotes>
<copyright>Copyright Christian Kratky 2016-2019</copyright>
<tags>MQTT Message Queue Telemetry Transport MQTTClient MQTTServer Server MQTTBroker Broker NETStandard IoT InternetOfThings Messaging Hardware Arduino Sensor Actuator M2M ESP Smart Home Cities Automation Xamarin</tags>


+ 0
- 1
Source/MQTTnet.AspnetCore/SpanBasedMqttPacketWriter.cs Parādīt failu

@@ -64,7 +64,6 @@ namespace MQTTnet.AspNetCore

GrowIfNeeded(propertyWriter.Length);
Write(propertyWriter.GetBuffer(), 0, propertyWriter.Length);
Commit(propertyWriter.Length);
}

public void Write(byte[] payload, int start, int length)


+ 21
- 0
Tests/MQTTnet.Core.Tests/MqttPacketSerializer_Tests.cs Parādīt failu

@@ -8,6 +8,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
using MQTTnet.Adapter;
using MQTTnet.Formatter;
using MQTTnet.Formatter.V3;
using MQTTnet.Formatter.V5;
using MQTTnet.Internal;
using MQTTnet.Packets;
using MQTTnet.Protocol;
@@ -258,6 +259,26 @@ namespace MQTTnet.Tests
Assert.IsTrue(deserialized.Properties.UserProperties.Any(x => x.Name == "Foo"));
}


[TestMethod]
public void SerializeV500_MqttPublishPacket_CorrelationData()
{
var data = "123456789";
var req = new MqttApplicationMessageBuilder()
.WithTopic("Foo")
.WithResponseTopic($"_")
.WithCorrelationData(Guid.NewGuid().ToByteArray())
.WithPayload(data)
.WithQualityOfServiceLevel(MqttQualityOfServiceLevel.AtMostOnce)
.Build();

var p = new MqttV500DataConverter().CreatePublishPacket(req);

var deserialized = Roundtrip(p, MqttProtocolVersion.V500);

Assert.IsTrue(p.Payload.SequenceEqual(deserialized.Payload));
}

[TestMethod]
public void DeserializeV311_MqttPublishPacket()
{


Notiek ielāde…
Atcelt
Saglabāt