From 88cf9d850e9daa5371b51b385cdf21fdc5ef9a0a Mon Sep 17 00:00:00 2001 From: Zhao Yongming Date: Sat, 2 Jul 2016 19:09:08 +0800 Subject: [PATCH] TS-4396: fix number_of_redirections off-by-one --- 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 b321fb8b83d..74388fc5717 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -1900,7 +1900,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(); @@ -7600,7 +7600,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; }