trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [trafficserver] branch master updated: redirection_tries should no be incremented twice
Date Thu, 14 Jun 2018 18:11:39 GMT
This is an automated email from the ASF dual-hosted git repository.

paziz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 652f821  redirection_tries should no be incremented twice
652f821 is described below

commit 652f82106a3bbb60cd3b200d234eac0b374e2d6c
Author: Syeda Persia Aziz <persia.aziz@yahoo.com>
AuthorDate: Mon Jun 11 16:06:35 2018 -0500

    redirection_tries should no be incremented twice
---
 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 ed7405a..f7b4ecf 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
paziz@apache.org.

Mime
View raw message