Browse Source

fixed another issue

release/3.x.x
JanEggers 5 years ago
parent
commit
a85792c392
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      Source/MQTTnet.AspnetCore/ReaderExtensions.cs

+ 8
- 1
Source/MQTTnet.AspnetCore/ReaderExtensions.cs View File

@@ -40,7 +40,14 @@ namespace MQTTnet.AspNetCore
var reader = new SpanBasedMqttPacketBodyReader();
reader.SetBuffer(buffer);

packet = formatter.Decode(new ReceivedMqttPacket(fixedheader, reader, buffer.Length + 2));
var receivedMqttPacket = new ReceivedMqttPacket(fixedheader, reader, buffer.Length + 2);

if (!formatter.ProtocolVersion.HasValue)
{
formatter.DetectProtocolVersion(receivedMqttPacket);
}

packet = formatter.Decode(receivedMqttPacket);
consumed = bodySlice.End;
observed = bodySlice.End;
return true;


Loading…
Cancel
Save