System.IndexOutOfRangeException: Index was outside the bounds of the array.
Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.1k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
10/19/2021 11:01:10 AM|Fatal|<>c__DisplayClass1.<receiveRequest>b__0|WebSocketSharp.WebSocketException: An exception has occurred while reading an HTTP request/response.
---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
at WebSocketSharp.HttpRequest.Parse(String[] headerParts)
at WebSocketSharp.HttpBase.Read[T](Stream stream, Func`2 parser, Int32 millisecondsTimeout)
--- End of inner exception stack trace ---
at WebSocketSharp.HttpBase.Read[T](Stream stream, Func`2 parser, Int32 millisecondsTimeout)
at WebSocketSharp.HttpRequest.Read(Stream stream, Int32 millisecondsTimeout)
at WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext..ctor(TcpClient tcpClient, String protocol, Boolean secure, ServerSslConfiguration sslConfig, Logger logger)
at WebSocketSharp.Ext.GetWebSocketContext(TcpClient tcpClient, String protocol, Boolean secure, ServerSslConfiguration sslConfig, Logger logger)
at WebSocketSharp.Server.WebSocketServer.<>c__DisplayClass1.<receiveRequest>b__0(Object state)
Running in SSL mode on .NET 5.0
It doesn't crash the application, but it does spam this message quite alot.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading WebSocketSharp.HttpRequest.Parse(String[] headerParts) and the surrounding WebSocketSharp.HttpBase.Read path named in the stack trace. Reproduce the SSL-mode behavior on .NET 5.0 if possible, then verify that the reported request no longer causes IndexOutOfRangeException or repeated fatal logging.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100