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;
    }
    
    ...
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to