Skip to content

Commit

Permalink
fix: Remove debugging code
Browse files Browse the repository at this point in the history
  • Loading branch information
Frooxius committed Jul 20, 2024
1 parent 5090845 commit 8dda1ab
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions System.Net.WebSockets.Client.Managed/ManagedWebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -731,14 +731,7 @@ private async Task<WebSocketReceiveResult> ReceiveAsyncPrivate(ArraySegment<byte
if (_dumpNext || (header.Opcode == MessageOpcode.Text &&
!TryValidateUtf8(new ArraySegment<byte>(payloadBuffer.Array, payloadBuffer.Offset, bytesToCopy), header.Fin && header.PayloadLength == 0, _utf8TextState)))
{
var data = new byte[bytesToCopy];
for (int i = 0; i < bytesToCopy; i++)
data[i] = payloadBuffer.Array[payloadBuffer.Offset + i];

File.WriteAllBytes(@$"D:\Temp\Websocket\Dump{DateTime.UtcNow.Ticks}_{_dumpNext}.bin", data);

_dumpNext = !_dumpNext;
//await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.InvalidPayloadData, WebSocketError.Faulted, cancellationToken).ConfigureAwait(false);
await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.InvalidPayloadData, WebSocketError.Faulted, cancellationToken).ConfigureAwait(false);
}

_lastReceiveHeader = header;
Expand Down

0 comments on commit 8dda1ab

Please sign in to comment.