You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by SolidWallOfCode <gi...@git.apache.org> on 2016/11/02 21:07:27 UTC

[GitHub] trafficserver pull request #769: TS 4593: Extend ip_allow.config to filter d...

Github user SolidWallOfCode commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/769#discussion_r83321967
  
    --- Diff: proxy/http/HttpSM.cc ---
    @@ -4726,6 +4727,44 @@ HttpSM::do_http_server_open(bool raw)
         milestones[TS_MILESTONE_SERVER_FIRST_CONNECT] = milestones[TS_MILESTONE_SERVER_CONNECT];
       }
     
    +  // Check for remap rule. If so, only apply ip_allow filter if it is activated (ip_allow_check_enabled_p set).
    +  // Otherwise, if no remap rule is defined, apply the ip_allow filter.
    +  if(!t_state.url_remap_success || (t_state.url_remap_success && t_state.url_map.getMapping()->ip_allow_check_enabled_p)) {
    --- End diff --
    
    I think this can be simplified to
    ```
    if(!t_state.url_remap_success || t_state.url_map.getMapping()->ip_allow_check_enabled_p))
    ```
    The second clause can only be checked if `t_state.url_remap_success` is `true` - otherwise the first clause would have been `true` and the evaluation stopped, so there's no need to check it again.


---
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.
---