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

WebSocket: non-blocking receiveFrame()/receiveBytes() with TLS connection may get stuck receiving header #4850

Open
obiltschnig opened this issue Jan 15, 2025 · 0 comments
Assignees

Comments

@obiltschnig
Copy link
Member

The reason is that calling receiveBytes() with MSG_PEEK does not look behind the current TLS record. If the current record contains an incomplete WebSocket header, peekHeader() will not be able to ever return a full header.

The solution is to not use MSG_PEEK, and instead do a regular receiveBytes() and keep the bytes in an internal buffer.

@obiltschnig obiltschnig added this to the Release 1.14.1 milestone Jan 15, 2025
@obiltschnig obiltschnig self-assigned this Jan 15, 2025
@obiltschnig obiltschnig added this to 1.14 Jan 15, 2025
obiltschnig added a commit that referenced this issue Jan 15, 2025
matejk pushed a commit that referenced this issue Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant