-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Websocket client closes with "unexpected reserved bits 0x60" on phantom packet #373
Comments
Run the application with the race detector and report back after fixing any issues. Include information about the server and how to reproduce the problem. Note that concurrent reads are not supported. |
I "fixed" the problem by resetting the internal buffer at the end of Line 1024 in cd94665
I haven't run it with race detector, but I am also only reading from the websocket in a single location. After dumping the entire buffer, it became clear that there was data from previous packets stuck in there, and for some reason they are getting pushed to the end of the buffer. I'm still not entirely sure what's going on, but my gut instinct is that it has something to do with the payload size value in the header and how we calculate whether or not we have the entire message. But that's just a feeling. I am not familiar enough the entire model to understand what is actually going on under the hood. |
Run the race detector. I want to rule out the possibility that the application is reading the connection concurrently before investigating further. |
It looks like I do have race conditions, which is very interesting. I'll fix those and see if that fixes the problem. |
It looks like fixing the concurrency issue worked! Although I'm still confused about what was going on.... Hopefully this issue will help other people with the same issue. Thank you for your help @garyburd |
I have an open client websocket connection and recieve data just find until I hit a particular packet:
This packet gets acked and then the websocket client connection gets closed with the error:
websocket: unexpected reserved bits 0x60
The value of
p
(websocket/conn.go
Line 779 in cd94665
6d6d
.This is entirely reproduceable.
I have been unable to find the total packet being read to determine why it is reading
6d6d
.Information on how to dump the contents of the entire packet being read or why/where it would be reading these phantom values would be great.
The text was updated successfully, but these errors were encountered: