mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 11:45:43 +08:00
Fix freezes in _AsyncLock_ (#1549)
This commit is contained in:
@@ -6,13 +6,13 @@ using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using MQTTnet.Exceptions;
|
||||
using MQTTnet.Implementations;
|
||||
using MQTTnet.Internal;
|
||||
|
||||
namespace MQTTnet.Formatter
|
||||
{
|
||||
public sealed class MqttBufferReader
|
||||
{
|
||||
byte[] _buffer = PlatformAbstractionLayer.EmptyByteArray;
|
||||
byte[] _buffer = EmptyBuffer.Array;
|
||||
int _initialPosition;
|
||||
int _length;
|
||||
int _position;
|
||||
@@ -29,7 +29,7 @@ namespace MQTTnet.Formatter
|
||||
|
||||
if (length == 0)
|
||||
{
|
||||
return PlatformAbstractionLayer.EmptyByteArray;
|
||||
return EmptyBuffer.Array;
|
||||
}
|
||||
|
||||
ValidateReceiveBuffer(length);
|
||||
@@ -66,7 +66,7 @@ namespace MQTTnet.Formatter
|
||||
|
||||
if (bufferLength == 0)
|
||||
{
|
||||
return PlatformAbstractionLayer.EmptyByteArray;
|
||||
return EmptyBuffer.Array;
|
||||
}
|
||||
|
||||
var buffer = new byte[bufferLength];
|
||||
|
||||
@@ -5,12 +5,13 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using MQTTnet.Implementations;
|
||||
using MQTTnet.Internal;
|
||||
|
||||
namespace MQTTnet.Formatter
|
||||
{
|
||||
public readonly struct MqttPacketBuffer
|
||||
{
|
||||
static readonly ArraySegment<byte> EmptyPayload = PlatformAbstractionLayer.EmptyByteArraySegment;
|
||||
static readonly ArraySegment<byte> EmptyPayload = EmptyBuffer.ArraySegment;
|
||||
|
||||
public MqttPacketBuffer(ArraySegment<byte> packet, ArraySegment<byte> payload)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user