This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/7.1.x by this push:
     new 5f60ca0  redirection_tries should no be incremented twice
5f60ca0 is described below

commit 5f60ca0d697ff26fdef573a92c1de6a0de9c00d8
Author: Syeda Persia Aziz <[email protected]>
AuthorDate: Mon Jun 11 16:06:35 2018 -0500

    redirection_tries should no be incremented twice
    
    (cherry picked from commit 652f82106a3bbb60cd3b200d234eac0b374e2d6c)
---
 proxy/http/HttpSM.cc | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 7309f54..5a7d5f4 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -1577,7 +1577,6 @@ HttpSM::handle_api_return()
     // state_read_server_reponse_header and never get into this logic again.
     if (enable_redirection && !t_state.redirect_info.redirect_in_process && 
is_redirect_required() &&
         (redirection_tries <= t_state.txn_conf->number_of_redirections)) {
-      ++redirection_tries;
       do_redirect();
     }
     // we have further processing to do
@@ -1913,9 +1912,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))) {
       this->disable_redirect();
     }
 
@@ -7762,6 +7759,7 @@ HttpSM::do_redirect()
         }
       }
 
+      ++redirection_tries;
       if (redirect_url != nullptr) {
         redirect_request(redirect_url, redirect_url_len);
         ats_free((void *)redirect_url);

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to