Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D7084200B35 for ; Tue, 5 Jul 2016 19:46:33 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D598D160A60; Tue, 5 Jul 2016 17:46:33 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4F583160A2C for ; Tue, 5 Jul 2016 19:46:33 +0200 (CEST) Received: (qmail 67253 invoked by uid 500); 5 Jul 2016 17:46:32 -0000 Mailing-List: contact dev-help@trafficserver.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@trafficserver.apache.org Delivered-To: mailing list dev@trafficserver.apache.org Received: (qmail 67242 invoked by uid 99); 5 Jul 2016 17:46:32 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jul 2016 17:46:32 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 11849E01C1; Tue, 5 Jul 2016 17:46:32 +0000 (UTC) From: jpeach To: dev@trafficserver.apache.org Reply-To: dev@trafficserver.apache.org References: In-Reply-To: Subject: [GitHub] trafficserver pull request #786: TS-4396: fix number_of_redirections off-by-... Content-Type: text/plain Message-Id: <20160705174632.11849E01C1@git1-us-west.apache.org> Date: Tue, 5 Jul 2016 17:46:32 +0000 (UTC) archived-at: Tue, 05 Jul 2016 17:46:34 -0000 Github user jpeach commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/786#discussion_r69606800 --- Diff: proxy/http/HttpSM.cc --- @@ -7618,6 +7616,8 @@ HttpSM::do_redirect() return; } + redirection_tries++; + --- End diff -- Right below here, we repeat the test on ``number_of_redirections`` with ``is_redirect_required(). The condition is different however, since this code will not redirect with ``number_of_redirections`` and ``is_redirect_required()`` will. I don't think that this is the right place to increment ``redirection_tries``, though it is an improvement. How about incrementing it in ``redirect_request()``? Or at least defer until we know we are actually going to call ``redirect_request``. We should restructure this function like this: ```C if (!is_redirect_required()) { tunnel.deallocate_redirect_post_buffers(); enable_redirection = false; return; } ... ``` --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---