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/09/12 21:23:13 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_r78457571
  
    --- Diff: proxy/IPAllow.cc ---
    @@ -271,10 +316,16 @@ IpAllow::BuildTable()
               }
     
               if (method_found) {
    -            _acls.push_back(AclRecord(acl_method_mask, line_num, nonstandard_methods, deny_nonstandard_methods));
    -            // Color with index because at this point the address
    -            // is volatile.
    -            _map.fill(&addr1, &addr2, reinterpret_cast<void *>(_acls.length() - 1));
    +            if(is_dest_ip) {
    +              _dest_acls.push_back(AclRecord(acl_method_mask, line_num, nonstandard_methods, deny_nonstandard_methods));
    --- End diff --
    
    These cases should be more compact by selecting the map then applying the fill.
    ```
    Vec<AclRecord>& acls = is_dest_ip ? _dest_acls : _src_acls;
    IpMap& map = is_dest_ip ? _dest_map : _src_map;
    acls.push_back(AclRecord(acl_method_mask, line_num, nonstandard_methods, deny_nonstandard_methods));
    map.fill(&addr1, &addr2, reinterpret_cast<void *>(_dest_acls.length() - 1));
    ```



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