-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Hi
I found a bug in your SimpleWebSocketServer.
Class WebSocketHttpServer, function RunServer
buffer is to small when headers contains cookies
I propose this version for reading headers :
`...
byte[] temp = new byte[maxRead];
byte[] buffer= new byte[maxRead];
int bytesRead;
int totalBytes = 0;
while ((bytesRead=await stream.ReadAsync(temp, 0, maxRead))>0)
{
System.Array.Copy(temp, 0, buffer, totalBytes, bytesRead);
totalBytes += bytesRead;
if (stream.DataAvailable)
System.Array.Resize(ref buffer, totalBytes+bytesRead);
else
break;
}
string received = Encoding.UTF8.GetString(buffer, 0, totalBytes);
....`
regards
Nicolas
Metadata
Metadata
Assignees
Labels
No labels