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/07/11 22:52:26 UTC

[trafficserver] branch master updated: Make sure to add resources for all rules in a hook

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 7426789  Make sure to add resources for all rules in a hook
7426789 is described below

commit 74267895891b72012c1dbc93593de34712637c5f
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Tue Jul 11 14:48:58 2017 -0600

    Make sure to add resources for all rules in a hook
    
    This fixes #2261.
---
 plugins/header_rewrite/ruleset.cc | 14 ++++++++++++++
 plugins/header_rewrite/ruleset.h  |  3 ++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/plugins/header_rewrite/ruleset.cc b/plugins/header_rewrite/ruleset.cc
index 3ce874e..9dfe89c 100644
--- a/plugins/header_rewrite/ruleset.cc
+++ b/plugins/header_rewrite/ruleset.cc
@@ -100,3 +100,17 @@ RuleSet::add_operator(Parser &p, const char *filename, int lineno)
 
   return false;
 }
+
+ResourceIDs
+RuleSet::get_all_resource_ids() const
+{
+  ResourceIDs ids = _ids;
+  RuleSet *tmp    = this->next;
+
+  while (tmp) {
+    ids = static_cast<ResourceIDs>(ids | tmp->get_resource_ids());
+    tmp = tmp->next;
+  }
+
+  return ids;
+}
diff --git a/plugins/header_rewrite/ruleset.h b/plugins/header_rewrite/ruleset.h
index 6212aba..043a03b 100644
--- a/plugins/header_rewrite/ruleset.h
+++ b/plugins/header_rewrite/ruleset.h
@@ -49,6 +49,7 @@ public:
   void append(RuleSet *rule);
   bool add_condition(Parser &p, const char *filename, int lineno);
   bool add_operator(Parser &p, const char *filename, int lineno);
+  ResourceIDs get_all_resource_ids() const;
 
   bool
   has_operator() const
@@ -75,7 +76,7 @@ public:
   }
 
   ResourceIDs
-  get_all_resource_ids() const
+  get_resource_ids() const
   {
     return _ids;
   }

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