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

Websocketpp example #22

Merged
merged 4 commits into from Jun 18, 2021
Merged

Conversation

acgreek
Copy link
Collaborator

@acgreek acgreek commented Jun 17, 2021

The websocketpp client connects to the websocket tls server but doesn't complete the tls handshake. For reference, I confirmed the websocketpp client is able to connect and send data to wss://echo.websocket.org

@lesismal
Copy link
Owner

so it is all right with llib 1.0.0?

@acgreek
Copy link
Collaborator Author

acgreek commented Jun 17, 2021 via email

lesismal added a commit that referenced this pull request Jun 17, 2021
@lesismal
Copy link
Owner

I reproduced this bug with your cpp example.

this commit works fine now, please try it.

@acgreek
Copy link
Collaborator Author

acgreek commented Jun 18, 2021

wow thanks, I didn't want to trouble you until I was certain. I'm think the problem was with websocketpp on linux as opposed to macos as it my personal developer laptop; the developer who reported issue is using linux. Is that the case; did you confirm the problem with linux?

@acgreek acgreek reopened this Jun 18, 2021
@lesismal
Copy link
Owner

wow thanks, I didn't want to trouble you until I was certain. I'm think the problem was with websocketpp on linux as opposed to macos as it my personal developer laptop; the developer who reported issue is using linux. Is that the case; did you confirm the problem with linux?

This is a half-frame-parsing bug, and all platforms should be affected.

The TLSConn uses the same buffer to read data, then passes the buffer to websocket.Upgrader to parse frame/message.
When there's only a half-frame, the upgrader will cache the buffer, it should make a copy of the buffer if needed, but there's a bug for the copying logic and the upgrader does not copy it.
When the Conn.Read next time, the buffer is overwritten which makes the upgrader's cache dirty, then everything goes wrong.

Thank you for pointing out this bug!

Please continue to monitor your service, if no more problems are found, we could release v1.0.3.

@lesismal lesismal merged commit 99f20f6 into lesismal:master Jun 18, 2021
@acgreek
Copy link
Collaborator Author

acgreek commented Jun 18, 2021

yes, developer confirmed this worked. Thank you so much

@lesismal
Copy link
Owner

yes, developer confirmed this worked. Thank you so much

my pleasure, you are welcome

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

Successfully merging this pull request may close these issues.

None yet

3 participants