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
Adds a new configuration proxy.config.http.allow_multi_range #3106
Conversation
| @@ -4428,24 +4428,47 @@ HttpSM::do_range_setup_if_necessary() | |||
| do_range_parse(field); | |||
|
|
|||
| if (t_state.range_setup == HttpTransact::RANGE_REQUESTED) { | |||
| bool do_transform = false; | |||
|
|
|||
| if (!t_state.range_in_cache) { | |||
| Debug("http_range", "range can't be satisfied from cache, force origin request"); | |||
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.
t_state.num_range_fields is -1 here.
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.
Not sure what you are saying here. How can it be -1, if we have
t_state.range_setup == HttpTransact::RANGE_REQUESTED
This gets set, as far as I can tell, in HttpSM::parse_range_and_compare, no ?
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.
Within HttpSM::parse_range_and_compare, if
- parse failed, goto Lfaild;
- the number of valid range is not greater than 0, goto Lfaild;
At the Lfaild, range_in_cache = false and num_range_fields = -1.
t_state.range_setup = HttpTransact::RANGE_REQUESTED and t_state.num_range_fields = nr only if nr > 0.
The valid value of num_range_fields should be -1 or any number great than 0.
proxy/http/HttpSM.cc
Outdated
| } else { | ||
| t_state.range_setup = HttpTransact::RANGE_NOT_SATISFIABLE; | ||
| } | ||
| } else { |
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.
t_state.num_range_fields is 1 here.
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.
Hmm, you saying I should reset num_range_fields to 0 ? That certainly seems reasonable, I've updated the PR with that change.
This is needed to prevent potential abuse with well formed multi- range requests.
|
This has many, but trivial, merge conflicts, primarily due to clang-formatting. |
|
Cheery-picked to 7.1.3 |
This is needed to prevent potential abuse with well formed multi-
range requests.