[ 
https://issues.apache.org/jira/browse/TS-4396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15362856#comment-15362856
 ] 

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_r69606800
  
    --- Diff: proxy/http/HttpSM.cc ---
    @@ -7618,6 +7616,8 @@ HttpSM::do_redirect()
         return;
       }
     
    +  redirection_tries++;
    +
    --- End diff --
    
    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 with ``number_of_redirections`` and 
``is_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:
    ```C
    if (!is_redirect_required()) {
        tunnel.deallocate_redirect_post_buffers();
        enable_redirection = false;
        return;
    }
    
    ...
    ```


> 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)

Reply via email to