-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Cap size of last chunk in raw read in WebServer #10724
Conversation
👋 Hello socram8888, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
Before, the raw read would time out if the content length was not a multiple of HTTP_RAW_BUFLEN, as it tried to read HTTP_RAW_BUFLEN bytes even if the last chunk should actually contain less.
73184b9
to
784ef0f
Compare
Test Results 56 files 56 suites 4m 19s ⏱️ Results for commit 8b77d91. ♻️ This comment has been updated with latest results. |
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.
It can be simpler with the original while comparison
Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
Description of Change
Cap size of last chunk in raw read in WebServer
Currently, the raw read would time out if the content length is not a multiple of HTTP_RAW_BUFLEN, as it tries to read HTTP_RAW_BUFLEN bytes even if the last chunk should actually contain less.
That introduces a five second delay before the final raw call to the handler is performed.
By capping the size to the amount of remaining bytes, this delay is removed.
Tests scenarios
Tested on an ESP32C3 using a modified UploadHugeFile example, and curl uploading any file with a size not multiple of 1436.
Related links
None