Skip to content
New issue

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

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

Already on GitHub? # to your account

Add a compat flag for increasing the WS message size limit #2164

Merged
merged 6 commits into from
Aug 2, 2024

Conversation

penalosa
Copy link
Collaborator

@penalosa penalosa commented May 24, 2024

This is one step towards addressing #2051 (Wrangler changes will also be needed)

@penalosa penalosa requested review from a team as code owners May 24, 2024 20:15
@penalosa penalosa requested review from byule and jp4a50 May 24, 2024 20:15
@penalosa penalosa force-pushed the penalosa/increase-ws-size branch from 5c85dd3 to 25ef42e Compare May 24, 2024 20:23
src/workerd/api/web-socket.c++ Outdated Show resolved Hide resolved
@@ -425,6 +425,9 @@ class WebSocket: public EventTarget {
// `close()`, thereby preventing calls to `send()` even after we wake from hibernation.
bool closedOutgoingForHib = false;

// Maximum allowed size for WebSocket messages
size_t maxMessageSize = 1u << 20;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the constant kj::WebSocket::SUGGESTED_MAX_MESSAGE_SIZE.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -425,6 +425,9 @@ class WebSocket: public EventTarget {
// `close()`, thereby preventing calls to `send()` even after we wake from hibernation.
bool closedOutgoingForHib = false;

// Maximum allowed size for WebSocket messages
size_t maxMessageSize = 1u << 20;
Copy link
Member

@kentonv kentonv May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having this be a member of WebSocket, could you pass it as a parameter to readLoop() (reading the feature flag in startReadLoop())?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@petebacondarwin
Copy link
Contributor

Probably related: cloudflare/workers-sdk#6219

@RamIdeas RamIdeas force-pushed the penalosa/increase-ws-size branch from 998d373 to e1fcf20 Compare August 2, 2024 12:12
@kentonv kentonv merged commit fc77758 into main Aug 2, 2024
9 checks passed
@kentonv kentonv deleted the penalosa/increase-ws-size branch August 2, 2024 15:13
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants