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

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


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

commit 17f8f796b016969b5118b5f88039accd7d5d1002
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 bf3f852..5fc5cd8 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -1603,7 +1603,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();
     } else if (redirection_tries > t_state.txn_conf->number_of_redirections) {
       t_state.squid_codes.subcode = SQUID_SUBCODE_NUM_REDIRECTIONS_EXCEEDED;
@@ -1937,9 +1936,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();
     }
 
@@ -7642,6 +7639,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