Update uWebSockets submodule: replace maxRemainingBodyLength() with onDataV2#1252
Draft
Update uWebSockets submodule: replace maxRemainingBodyLength() with onDataV2#1252
Conversation
…gBodyLength() Co-authored-by: uNetworkingAB <110806833+uNetworkingAB@users.noreply.github.com> Agent-Logs-Url: https://github.com/uNetworking/uWebSockets.js/sessions/7381342f-ed36-4f1c-ad98-304260ebef6e
Copilot
AI
changed the title
[WIP] Update uWebSockets submodule and modify onDataV2
Update uWebSockets submodule: replace maxRemainingBodyLength() with onDataV2
Mar 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstream uWebSockets removed
maxRemainingBodyLength()fromHttpResponseand replaced it withonDataV2, which passesmaxRemainingBodyLengthdirectly as auint64_tcallback parameter (0= last chunk,UINT64_MAX= chunked transfer encoding in-progress).Changes
uWebSocketstoe42d69f("Remove maxRemainingBodyLength(), add onDataV2")res_onStream: switch fromonData(fn(data, bool last))+res->maxRemainingBodyLength()call inside handler toonDataV2(fn(data, uint64_t maxRemainingBodyLength)); dropsrescapture from lambdares_onFullData: switch toonDataV2; replacelastbool withmaxRemainingBodyLength == 0; update preallocation hint fromres->maxRemainingBodyLength()todata.size() + maxRemainingBodyLength(guards correctly againstUINT64_MAXfor chunked encoding)res_maxRemainingBodyLengthwrapper function and its prototype registrationmaxRemainingBodyLength(): bigintfromHttpResponseindocs/index.d.ts✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.