[
https://issues.apache.org/jira/browse/TS-4396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15364783#comment-15364783
]
ASF GitHub Bot commented on TS-4396:
------------------------------------
Github user jpeach commented on a diff in the pull request:
https://github.com/apache/trafficserver/pull/786#discussion_r69782549
--- Diff: proxy/http/HttpSM.cc ---
@@ -1954,9 +1954,7 @@ HttpSM::state_read_server_response_header(int event,
void *data)
t_state.api_next_action =
HttpTransact::SM_ACTION_API_READ_RESPONSE_HDR;
// if exceeded limit deallocate postdata buffers and disable
redirection
- if (enable_redirection && (redirection_tries <
t_state.txn_conf->number_of_redirections)) {
- ++redirection_tries;
- } else {
+ if (enable_redirection && (redirection_tries >=
t_state.txn_conf->number_of_redirections)) {
--- End diff --
Yes, I asked about this because I was not sure whether we should be
checking the response here. The problem that I see with this change is that the
condition disagrees with ``is_redirect_required()`` when ``redirection_tries``
is equal to ``number_of_redirections``.
> Off-by-one error in max redirects with redirection enabled
> ----------------------------------------------------------
>
> Key: TS-4396
> URL: https://issues.apache.org/jira/browse/TS-4396
> Project: Traffic Server
> Issue Type: Bug
> Components: Core, Network
> Reporter: Felix Buenemann
> Assignee: Zhao Yongming
> Fix For: 7.0.0
>
>
> There is a problem in the current stable version 6.1.1 where the setting
> proxy.config.http.number_of_redirections = 1 is incorrectly checked when
> following origin redirects by setting proxy.config.http.redirection_enabled =
> 1.
> If the requested URL is not already cached, ATS returns the redirect response
> to the client instead of storing the target into the cache and returning it
> to the client.
> The problem can be fixed by using proxy.config.http.number_of_redirections =
> 2, but we are only following one redirect, so this is wrong.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)