Преглед изворни кода

fixed index out of range

release/3.x.x
Jan Eggers пре 7 година
родитељ
комит
d594b1447f
2 измењених фајлова са 3 додато и 1 уклоњено
  1. +1
    -0
      Frameworks/MQTTnet.NetStandard/Implementations/WebSocketStream.cs
  2. +2
    -1
      Frameworks/MQTTnet.UniversalWindows/Implementations/WebSocketStream.cs

+ 1
- 0
Frameworks/MQTTnet.NetStandard/Implementations/WebSocketStream.cs Прегледај датотеку

@@ -41,6 +41,7 @@ namespace MQTTnet.Implementations
{
var response = await _webSocket.ReceiveAsync(new ArraySegment<byte>(buffer, currentOffset, count), cancellationToken).ConfigureAwait(false);
currentOffset += response.Count;
count -= response.Count;

if (response.MessageType == WebSocketMessageType.Close)
{


+ 2
- 1
Frameworks/MQTTnet.UniversalWindows/Implementations/WebSocketStream.cs Прегледај датотеку

@@ -27,7 +27,8 @@ namespace MQTTnet.Implementations
{
var response = await _webSocket.ReceiveAsync(new ArraySegment<byte>(buffer, currentOffset, count), cancellationToken).ConfigureAwait(false);
currentOffset += response.Count;
count -= response.Count;

if (response.MessageType == WebSocketMessageType.Close)
{
await _webSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty, cancellationToken).ConfigureAwait(false);


Loading…
Откажи
Сачувај