-
Notifications
You must be signed in to change notification settings - Fork 336
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
Conversation
5c85dd3
to
25ef42e
Compare
src/workerd/api/web-socket.h
Outdated
@@ -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; |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/workerd/api/web-socket.h
Outdated
@@ -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; |
There was a problem hiding this comment.
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()
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably related: cloudflare/workers-sdk#6219 |
998d373
to
e1fcf20
Compare
This is one step towards addressing #2051 (Wrangler changes will also be needed)