-
Notifications
You must be signed in to change notification settings - Fork 848
TS-4396: fix number_of_redirections off-by-one #786
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
Conversation
proxy/http/HttpSM.cc
Outdated
| } | ||
|
|
||
| redirection_tries++; | ||
|
|
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.
Right below here, we repeat the test on number_of_redirections with is_redirect_required(). The condition is different however, since this code will not redirect withnumber_of_redirectionsandis_redirect_required()`` will.
I don't think that this is the right place to increment redirection_tries, though it is an improvement. How about incrementing it in redirect_request()? Or at least defer until we know we are actually going to call redirect_request.
We should restructure this function like this:
if (!is_redirect_required()) {
tunnel.deallocate_redirect_post_buffers();
enable_redirection = false;
return;
}
...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, looks like better to do redirection_tries++ when setting redirect_in_process = true, if you consider a really redirection. good catch.
|
[approve ci] |
|
Closing since there is a new PR for this #2092 |
* Http2 to origin This implements the HTTP/2 to origin feature. * Adding window size and flow control out parameters. * Handle set_connect_fail in ConnectingEntry correctly When ConnectingEntry handled a connection failure, it could clear the error value passed to set_connect_fail. This would incorrectly result in the server not being marked down by hostdb. This patch ensures that the error code passed to set_connect_fail is always an error value when handling a connection failure. * Send WINDOW_UPDATE for session when stream ends for other streams * pass through RST_STREAM frame * set_cause_of_death_errno * Http2 to origin fix (#4) * Fix for connection level window mismatch + force connection level window update * Fix for HPACK corruption on closed streams Todo: check stream level error returns, these should still decode the headers to prevent HPACK corruption for following header frames --------- Co-authored-by: Kees Spoelstra <kd.spoelstra@gmail.com> * proxy.config.exec_thread.autoconfig -> ''.enabled This is a changed needed to the new HTTP/2 to origin tests for the records.yaml update. * Revert a restart_receiving call causing POST issues The post-continue.test.py AuTest demonstrated that the restart_receiving call was causing the first 64KB of data from a POST to be lost. * Expand tunnel_handler to expect VC_EVENT_INACTIVITY_TIMEOUT The HttpSM::tunnel_handler expects the tunnel to be going away and asserts that the event it receives is HTTP_TUNNEL_EVENT_DONE. However, the tunnel can be going away due to timeout as well. Adding VC_EVENT_INACTIVITY_TIMEOUT as a possible event in that function. * remove the buffer reader from the consumer's vc Co-authored-by: Brian Neradt <brian.neradt@gmail.com> Co-authored-by: Fei Deng <feid@oath.com> Co-authored-by: keesspoelstra <kd.spoelstra+github@gmail.com> Co-authored-by: Kees Spoelstra <kd.spoelstra@gmail.com>
please test