You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2017/06/21 22:09:56 UTC

[trafficserver] 01/03: TS-4396: fix number_of_redirections off-by-one

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

commit 9a7078753c4d904ba1638b3f64ee6371efa84023
Author: Zhao Yongming <mi...@gmail.com>
AuthorDate: Sat Jul 2 19:09:08 2016 +0800

    TS-4396: fix number_of_redirections off-by-one
    
    (cherry picked from commit 452a2dc6466eae58ac03a3d29868130815e599c0)
---
 proxy/http/HttpSM.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 2ab33d8..c8da407 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -1972,7 +1972,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)) {
+    if (enable_redirection && (redirection_tries <= t_state.txn_conf->number_of_redirections)) {
       ++redirection_tries;
     } else {
       tunnel.deallocate_redirect_postdata_buffers();
@@ -7758,7 +7758,7 @@ void
 HttpSM::do_redirect()
 {
   DebugSM("http_redirect", "[HttpSM::do_redirect]");
-  if (!enable_redirection || redirection_tries >= t_state.txn_conf->number_of_redirections) {
+  if (!enable_redirection || redirection_tries > t_state.txn_conf->number_of_redirections) {
     tunnel.deallocate_redirect_postdata_buffers();
     return;
   }

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.