Added naive content length to upload struct #5142
Merged
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.
Content length provides context into the size of the upload, it's not the exact form body size because it's off by the request header and other request info, but it was already parsed by the library and provides little to no additional overhead to pass on for use in request handlers.
This allows you the opportunity to abort if the file will be too large, or approximate the upload percentage. The only impact of this change is extending the HTTPUpload struct by a size_t, and the one-time cost of assigning it.