Quellcode durchsuchen

fixed index out of range

release/3.x.x
Jan Eggers vor 7 Jahren
Ursprung
Commit
d594b1447f
2 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
  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 Datei anzeigen

@@ -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 Datei anzeigen

@@ -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);


Laden…
Abbrechen
Speichern