Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckForDoubleRead false possitive in WebSocketConnectionRfc6455.cs #6

Closed
weweilep opened this issue Oct 17, 2014 · 4 comments
Closed

Comments

@weweilep
Copy link

If you send an empty string as the payload over the stream, ReadMessage/ReadString and its variants will throw an exception from CheckForDoubleRead line 253

if (CurrentHeader != null)
    throw new WebSocketException("There is an ongoing message that is being readed from somewhere else");

I haven't taken the time to research the cause, but I'm guessing the header doesn't get cleared after a 0 payload message.

This can be reproduced by sending an empty string to the EchoServer example.

@weweilep
Copy link
Author

I should note, it does appear to send/receive the empty packet, but it appears the next poll has the previous header retained.

vtortola added a commit that referenced this issue Oct 17, 2014
Issue #6: When a message was empty, the header was not correctly
disposed.
@vtortola
Copy link
Owner

Hi,

Thank you for taking the time to report this, I could reproduce the problem as you explained and I am confident I fixed it in this commit I just did: 0205272

I will take some days till I release a new NuGet package, in the mean time you can use this 2.1.2 pre-release or the source directly (as I suspect you are already doing).

Let me know if you have any further issue.

Cheers.

@weweilep
Copy link
Author

Yes, this appears to correct the issue in all my test cases.

Thanks for the prompt response and update!

@vtortola
Copy link
Owner

No problem 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants