-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Handle large octet-stream #9430
Conversation
This is much better now :) |
BTW I see that you target the 2.x branch. Do you plan to make PR to master also? Else this feature would exist only on 2.0.x versions |
It would be nice to do the same PR for the master, but I'm using PlatformIO and I can't target the master. And I didn't want to work on the master if this PR wasn't validated. 😄 |
Code looks good. Can you please add slightly better description and also a small example to show how this feature can be used. |
I added an exemple and improved the description. |
@P-R-O-C-H-Y could you give this a shot and also evaluate the port to 3.0.0? |
because it's changing the current behavior, I lean towards having this for 3.0.0 and not for 2.0.15. We do not want to break people's code in a bugfix release. Major v3 is a much better fit |
@Jason2866 could you help @nathannau try this on 3.0.0 and PIO? |
@nathannau To test a PR with Platformio against latest master. -> Make a branch with your changes from branch master and do the following setup in Platformio
|
I'm currently testing whether the "Content-Type" is "Application/octet-stream". |
@nathannau it's important that current behavior is not changed much for the average folk. Simple request should go fine as they do right now and use raw only when wanted to. |
@me-no-dev Exactly. This patch would retain backwards compatibility while adding the ability to do more things if needed. |
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.
Just some fixes
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.
Tested with @lucasssvaz fix which is needed. After the fix we can merge.
@nathannau this is currently blocking 2.0.15 release. Is there any chance that you take care of the notes from @lucasssvaz ? If you do not have the time, we could do that for you as well and merge the PR |
Issue
In scenarios where the request body size exceeds the available RAM, the ESP fails to allocate sufficient memory to process the request in one go.
Change
Now, when the "Content-Type" of the request is "application/octet-stream", it will attempt to call the "ufn" function of the handler, similar to how it handles multipart requests.
Code Example: