Add config: buf_read_size#3068
Open
southball wants to merge 3 commits intobenoitc:masterfrom
Open
Conversation
|
|
||
| **Default:** ``1024`` | ||
|
|
||
| Buffer read size from request data |
There was a problem hiding this comment.
Suggested change
| Buffer read size from request data | |
| Buffer read size for reading request data from socket |
| if buf_read_size is None: | ||
| return 1024 | ||
|
|
||
| return int(buf_read_size) |
There was a problem hiding this comment.
i think we should add some exception handling here if buf_read_size is not convertable to int and return a explanatory error.
|
@southball do you think we need to use this buffer size config according to content-length because for small request data setting a big buffer size could decrease the performance? |
Contributor
|
@aamirawan7584 The way we use it, a larger setting than what was sent should not negatively impact the processing of small requests. However, incorrectly reducing our buffer sizes in response to arbitrary client input could cause trouble, so should not be attempted without good reasons & mechanisms. |
pajod
approved these changes
May 21, 2024
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.
Resolves #2596.
Add the
--buf-read-sizeoption to set the block size when reading request body.