Olivine-Labs / Alchemy-Websockets

An extremely efficient C# WebSocket server.
http://AlchemyWebsockets.net
Other
309 stars 105 forks source link

Header longer then 512 bytes maybe incorrectly parsed #105

Open brokkc1 opened 10 years ago

brokkc1 commented 10 years ago

As title suggests, during the handshake the connecting client sends a header that is longer then 512 bytes then it is possible for the connection to fail. It depends where the client places the security key (ie above the 512 cut off or below).

I fixed the issue by caching the header byte buffer and concatenating till the end of the HTTP header is received "\r\n\r\n" then parsing the cache at that point. Of cause increasing the buffer length may fix the issue, but that is until the a bigger payload arrives.

Happens with the latest Nuget release and latest build from GIT.

mokeev1995 commented 9 years ago

Unforchantly, the last build at NuGet is really old. We should compile the last version from Git.