You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ch...@apache.org on 2013/07/24 05:17:17 UTC

git commit: TS-1280 add url match token about cache control rule

Updated Branches:
  refs/heads/master 0257a617b -> 2d9ad48c5


TS-1280 add url match token about cache control rule


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/2d9ad48c
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/2d9ad48c
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/2d9ad48c

Branch: refs/heads/master
Commit: 2d9ad48c5075b40ebfd864b1e9ce4f097d84b85c
Parents: 0257a61
Author: Chen Bin <ku...@taobao.com>
Authored: Wed Jul 24 11:16:25 2013 +0800
Committer: Chen Bin <ku...@taobao.com>
Committed: Wed Jul 24 11:16:25 2013 +0800

----------------------------------------------------------------------
 CHANGES                             |   2 +
 iocore/dns/SplitDNS.cc              |   2 +-
 lib/ts/MatcherUtils.cc              |   5 +-
 lib/ts/MatcherUtils.h               |   4 +-
 mgmt/api/CfgContextImpl.cc          |  10 ++
 mgmt/api/CfgContextUtils.cc         |   7 ++
 mgmt/api/include/mgmtapi.h          |   1 +
 mgmt/api/remote/APITestCliRemote.cc |   9 ++
 proxy/ControlMatcher.cc             | 159 ++++++++++++++++++++++++++++++-
 proxy/ControlMatcher.h              |  39 +++++++-
 proxy/ParentSelection.cc            |   2 +-
 proxy/congest/Congestion.cc         |   1 +
 12 files changed, 234 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2d9ad48c/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 5597d10..5bcf4f3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
 Changes with Apache Traffic Server 3.3.5
 
 
+  *) [TS-1280] add url match token about cache control rule.
+
   *) [TS-2064] Fix the authproxy plugin to send an error body.
 
   *) [TS-2041] Allow environment values to override records.config settings.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2d9ad48c/iocore/dns/SplitDNS.cc
----------------------------------------------------------------------
diff --git a/iocore/dns/SplitDNS.cc b/iocore/dns/SplitDNS.cc
index b00c89f..372d97c 100644
--- a/iocore/dns/SplitDNS.cc
+++ b/iocore/dns/SplitDNS.cc
@@ -55,7 +55,7 @@ static ClassAllocator<DNSRequestData> DNSReqAllocator("DNSRequestDataAllocator")
    cases.
    -------------------------------------------------------------- */
 const matcher_tags sdns_dest_tags = {
-  "dest_host", "dest_domain", NULL, "url_regex", NULL, true
+  "dest_host", "dest_domain", NULL, "url_regex", "url", NULL, true
 };
 
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2d9ad48c/lib/ts/MatcherUtils.cc
----------------------------------------------------------------------
diff --git a/lib/ts/MatcherUtils.cc b/lib/ts/MatcherUtils.cc
index 3f831a2..593b001 100644
--- a/lib/ts/MatcherUtils.cc
+++ b/lib/ts/MatcherUtils.cc
@@ -275,6 +275,7 @@ const char *matcher_type_str[] = {
   "domain",
   "ip",
   "url_regex",
+  "url",
   "host_regex"
 };
 
@@ -381,7 +382,7 @@ processDurationString(char *str, int *seconds)
 }
 
 const matcher_tags http_dest_tags = {
-  "dest_host", "dest_domain", "dest_ip", "url_regex", "host_regex", true
+  "dest_host", "dest_domain", "dest_ip", "url_regex", "url", "host_regex", true
 };
 
 const matcher_tags ip_allow_tags = {
@@ -552,6 +553,8 @@ parseConfigLine(char *line, matcher_line *p_line, const matcher_tags * tags)
         type = MATCH_DOMAIN;
       } else if (tags->match_regex && strcasecmp(tags->match_regex, label) == 0) {
         type = MATCH_REGEX;
+      } else if (tags->match_url && strcasecmp(tags->match_url, label) == 0) {
+        type = MATCH_URL;
       } else if (tags->match_host_regex && strcasecmp(tags->match_host_regex, label) == 0) {
         type = MATCH_HOST_REGEX;
       }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2d9ad48c/lib/ts/MatcherUtils.h
----------------------------------------------------------------------
diff --git a/lib/ts/MatcherUtils.h b/lib/ts/MatcherUtils.h
index 439ccf7..de390a8 100644
--- a/lib/ts/MatcherUtils.h
+++ b/lib/ts/MatcherUtils.h
@@ -71,7 +71,7 @@ const char *processDurationString(char *str, int *seconds);
 // The first class types we support matching on
 enum matcher_type
 { MATCH_NONE, MATCH_HOST, MATCH_DOMAIN,
-  MATCH_IP, MATCH_REGEX, MATCH_HOST_REGEX
+  MATCH_IP, MATCH_REGEX, MATCH_URL, MATCH_HOST_REGEX
 };
 extern const char *matcher_type_str[];
 
@@ -94,6 +94,7 @@ struct matcher_tags
   const char *match_domain;
   const char *match_ip;
   const char *match_regex;
+  const char *match_url;
   const char *match_host_regex;
   bool dest_error_msg;          // whether to use src or destination in any error messages
 
@@ -102,6 +103,7 @@ struct matcher_tags
       this->match_domain == NULL &&
       this->match_ip == NULL &&
       this->match_regex == NULL &&
+      this->match_url == NULL &&
       this->match_host_regex == NULL;
   }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2d9ad48c/mgmt/api/CfgContextImpl.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/CfgContextImpl.cc b/mgmt/api/CfgContextImpl.cc
index cb793ec..bcc7586 100644
--- a/mgmt/api/CfgContextImpl.cc
+++ b/mgmt/api/CfgContextImpl.cc
@@ -2015,6 +2015,13 @@ SplitDnsObj::SplitDnsObj(TokenList * tokens)
       }
       m_ele->pd_type = TS_PD_URL_REGEX;
       m_ele->pd_val = ats_strdup(tok->value);
+    } else if (strcmp(tok->name, "url") == 0) {
+      if ((m_ele->pd_type != TS_PD_UNDEFINED) || (m_ele->pd_val != NULL) || (!tok->value)) {
+        // fields are already defined!!
+        goto FORMAT_ERR;
+      }
+      m_ele->pd_type = TS_PD_URL;
+      m_ele->pd_val = ats_strdup(tok->value);
     } else if (strcmp(tok->name, "named") == 0) {
       if ((m_ele->dns_servers_addrs != NULL) || (!tok->value)) {
         // fields are already defined!!
@@ -2074,6 +2081,9 @@ SplitDnsObj::formatEleToRule()
   case TS_PD_URL_REGEX:
     pd_name = ats_strdup("url_regex");
     break;
+  case TS_PD_URL:
+    pd_name = ats_strdup("url");
+    break;
   default:
     pd_name = ats_strdup("");      // lv: just to make this junk workable
     // Handled here:

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2d9ad48c/mgmt/api/CfgContextUtils.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/CfgContextUtils.cc b/mgmt/api/CfgContextUtils.cc
index 7e458e7..2be8046 100644
--- a/mgmt/api/CfgContextUtils.cc
+++ b/mgmt/api/CfgContextUtils.cc
@@ -823,6 +823,9 @@ pdest_sspec_to_string(TSPrimeDestT pd, char *pd_val, TSSspec * sspec)
     case TS_PD_URL_REGEX:
       psize = snprintf(buf, sizeof(buf), "url_regex=%s ", pd_val);
       break;
+    case TS_PD_URL:
+      psize = snprintf(buf, sizeof(buf), "url=%s ", pd_val);
+      break;
     default:
       psize = 0;
       // Handled here:
@@ -998,6 +1001,8 @@ string_to_pdss_format(const char *str, TSPdSsFormat * pdss)
     pdss->pd_type = TS_PD_IP;
   } else if (strcmp(tokens[1], "url_regex") == 0) {
     pdss->pd_type = TS_PD_URL_REGEX;
+  } else if (strcmp(tokens[1], "url") == 0) {
+    pdss->pd_type = TS_PD_URL;
   } else {
     goto Lerror;
   }
@@ -1530,6 +1535,8 @@ tokens_to_pdss_format(TokenList * tokens, Token * first_tok, TSPdSsFormat * pdss
     pdss->pd_type = TS_PD_IP;
   } else if (strcmp(first_tok->name, "url_regex") == 0) {
     pdss->pd_type = TS_PD_URL_REGEX;
+  } else if (strcmp(first_tok->name, "url") == 0) {
+    pdss->pd_type = TS_PD_URL;
   } else {
     return NULL;                //INVALID primary destination specifier
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2d9ad48c/mgmt/api/include/mgmtapi.h
----------------------------------------------------------------------
diff --git a/mgmt/api/include/mgmtapi.h b/mgmt/api/include/mgmtapi.h
index 82eb1cf..c562733 100644
--- a/mgmt/api/include/mgmtapi.h
+++ b/mgmt/api/include/mgmtapi.h
@@ -239,6 +239,7 @@ extern "C"
     TS_PD_HOST,                /* hostname */
     TS_PD_IP,                  /* ip address */
     TS_PD_URL_REGEX,           /* regular expression in url */
+    TS_PD_URL,           /* regular expression in url */
     TS_PD_UNDEFINED
   } TSPrimeDestT;
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2d9ad48c/mgmt/api/remote/APITestCliRemote.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/remote/APITestCliRemote.cc b/mgmt/api/remote/APITestCliRemote.cc
index ad8702b..5d15632 100644
--- a/mgmt/api/remote/APITestCliRemote.cc
+++ b/mgmt/api/remote/APITestCliRemote.cc
@@ -301,6 +301,9 @@ print_pd_sspec(TSPdSsFormat info)
   case TS_PD_URL_REGEX:
     printf("Prime Url regex: url_regex=%s\n", info.pd_val);
     break;
+  case TS_PD_URL:
+    printf("Prime Url: url=%s\n", info.pd_val);
+    break;
   default:
     break;
   }
@@ -459,6 +462,9 @@ print_hosting_ele(TSHostingEle * ele)
   case TS_PD_URL_REGEX:
     printf("url_regex=%s\n", ele->pd_val);
     break;
+  case TS_PD_URL:
+    printf("url=%s\n", ele->pd_val);
+    break;
   default:
     printf("INVALID Prime Dest specifier\n");
     break;
@@ -697,6 +703,9 @@ print_split_dns_ele(TSSplitDnsEle * ele)
   case TS_PD_URL_REGEX:
     pd_name = ats_strdup("url_regex");
     break;
+  case TS_PD_URL:
+    pd_name = ats_strdup("url");
+    break;
   default:
     pd_name = ats_strdup("?????");
     // Handled here:

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2d9ad48c/proxy/ControlMatcher.cc
----------------------------------------------------------------------
diff --git a/proxy/ControlMatcher.cc b/proxy/ControlMatcher.cc
index 1a7fc49..018a1c3 100644
--- a/proxy/ControlMatcher.cc
+++ b/proxy/ControlMatcher.cc
@@ -226,6 +226,140 @@ template<class Data, class Result> char *HostMatcher<Data, Result>::NewEntry(mat
  *************************************************************/
 
 //
+// UrlMatcher<Data,Result>::UrlMatcher()
+//
+template<class Data, class Result> UrlMatcher<Data, Result>::UrlMatcher(const char *name, const char *filename):
+url_ht(NULL), num_el(-1), matcher_name(name), file_name(filename)
+{
+  url_ht = ink_hash_table_create(InkHashTableKeyType_String);
+}
+
+//
+// UrlMatcher<Data,Result>::~UrlMatcher()
+//
+template<class Data, class Result> UrlMatcher<Data, Result>::~UrlMatcher()
+{
+  ink_hash_table_destroy(url_ht);
+  for (int i = 0; i < num_el; i++) {
+    ats_free(url_str[i]);
+  }
+  delete[]url_str;
+  delete[]url_value;
+  delete[]data_array;
+}
+
+//
+// void UrlMatcher<Data,Result>::Print()
+//
+//   Debugging function
+//
+template<class Data, class Result> void UrlMatcher<Data, Result>::Print()
+{
+  printf("\tUrl Matcher with %d elements\n", num_el);
+  for (int i = 0; i < num_el; i++) {
+    printf("\t\tUrl: %s\n", url_str[i]);
+    data_array[i].Print();
+  }
+}
+
+//
+// void UrlMatcher<Data,Result>::AllocateSpace(int num_entries)
+//
+template<class Data, class Result> void UrlMatcher<Data, Result>::AllocateSpace(int num_entries)
+{
+  // Should not have been allocated before
+  ink_assert(array_len == -1);
+
+  data_array = NEW(new Data[num_entries]);
+  url_value = NEW(new int [num_entries]);
+  url_str = NEW(new char *[num_entries]);
+  memset(url_str, 0, sizeof(char *) * num_entries);
+  array_len = num_entries;
+  num_el = 0;
+}
+
+//
+// char* UrlMatcher<Data,Result>::NewEntry(matcher_line* line_info)
+//
+template<class Data, class Result> char *UrlMatcher<Data, Result>::NewEntry(matcher_line * line_info)
+{
+
+  Data *cur_d;
+  char *errBuf;
+  char *pattern;
+  int *value;
+
+  // Make sure space has been allocated
+  ink_assert(num_el >= 0);
+  ink_assert(array_len >= 0);
+
+  // Make sure we do not overrun the array;
+  ink_assert(num_el < array_len);
+
+  pattern = line_info->line[1][line_info->dest_entry];
+  // Make sure that the line_info is not bogus
+  ink_assert(line_info->dest_entry < MATCHER_MAX_TOKENS);
+  ink_assert(pattern != NULL);
+
+  if (ink_hash_table_lookup(url_ht, pattern, (void **)&value)) {
+    errBuf = (char *)ats_malloc(1024 * sizeof(char));
+    *errBuf = '\0';
+    snprintf(errBuf, 1024, "%s url expression error(have exist) at line %d position",
+                 matcher_name, line_info->line_num);
+    return errBuf;
+  }
+  
+  // Remove our consumed label from the parsed line
+  line_info->line[0][line_info->dest_entry] = 0;
+  line_info->num_el--;
+
+  // Fill in the parameter info
+  cur_d = data_array + num_el;
+  errBuf = cur_d->Init(line_info);
+
+  if (errBuf == NULL) {
+    url_str[num_el] = ats_strdup(pattern);
+    url_value[num_el] = num_el;
+    ink_hash_table_insert(url_ht, url_str[num_el], (void *)&url_value[num_el]);
+    num_el++;
+  }
+  return errBuf;
+}
+
+//
+// void UrlMatcher<Data,Result>::Match(RD* rdata, Result* result)
+//
+//   Coduncts a linear search through the regex array and
+//     updates arg result for each regex that matches arg URL
+//
+template<class Data, class Result> void UrlMatcher<Data, Result>::Match(RequestData * rdata, Result * result)
+{
+  char *url_str;
+  int *value;
+  
+  // Check to see there is any work to before we copy the
+  //   URL
+  if (num_el <= 0) {
+    return;
+  }
+
+  url_str = rdata->get_string();
+
+  // Can't do a regex match with a NULL string so
+  //  use an empty one instead
+  if (url_str == NULL) {
+    url_str = ats_strdup("");
+  }
+
+  if (ink_hash_table_lookup(url_ht, url_str, (void **)&value)) { 
+    Debug("matcher", "%s Matched %s with url at line %d", matcher_name, url_str, data_array[*value].line_num);
+    data_array[*value].UpdateMatch(result, rdata);
+  }
+
+  ats_free(url_str);
+}
+
+//
 // RegexMatcher<Data,Result>::RegexMatcher()
 //
 template<class Data, class Result> RegexMatcher<Data, Result>::RegexMatcher(const char *name, const char *filename):
@@ -558,7 +692,7 @@ template<class Data, class Result>
   char *config_file = NULL;
 
   flags = flags_in;
-  ink_assert(flags & (ALLOW_HOST_TABLE | ALLOW_REGEX_TABLE | ALLOW_IP_TABLE));
+  ink_assert(flags & (ALLOW_HOST_TABLE | ALLOW_REGEX_TABLE | ALLOW_URL_TABLE | ALLOW_IP_TABLE));
 
   config_tags = tags;
   ink_assert(config_tags != NULL);
@@ -576,6 +710,7 @@ template<class Data, class Result>
   ats_free(config_file);
 
   reMatch = NULL;
+  urlMatch = NULL;
   hostMatch = NULL;
   ipMatch = NULL;
   hrMatch = NULL;
@@ -592,6 +727,7 @@ template<class Data, class Result> ControlMatcher<Data, Result>::~ControlMatcher
   ats_free(config_file_var);
 
   delete reMatch;
+  delete urlMatch;
   delete hostMatch;
   delete ipMatch;
   delete hrMatch;
@@ -610,6 +746,9 @@ template<class Data, class Result> void ControlMatcher<Data, Result>::Print()
   if (reMatch != NULL) {
     reMatch->Print();
   }
+  if (urlMatch != NULL) {
+    urlMatch->Print();
+  }
   if (ipMatch != NULL) {
     ipMatch->Print();
   }
@@ -633,6 +772,9 @@ template<class Data, class Result> void ControlMatcher<Data, Result>::Match(Requ
   if (reMatch != NULL) {
     reMatch->Match(rdata, result);
   }
+  if (urlMatch != NULL) {
+    urlMatch->Match(rdata, result);
+  }
   if (ipMatch != NULL) {
     ipMatch->Match(rdata->get_ip(), rdata, result);
   }
@@ -667,6 +809,7 @@ template<class Data, class Result> int ControlMatcher<Data, Result>::BuildTableF
   // type counts
   int hostDomain = 0;
   int regex = 0;
+  int url = 0;
   int ip = 0;
   int hostregex = 0;
 
@@ -715,6 +858,9 @@ template<class Data, class Result> int ControlMatcher<Data, Result>::BuildTableF
         case MATCH_REGEX:
           regex++;
           break;
+        case MATCH_URL:
+          url++;
+          break;
         case MATCH_HOST_REGEX:
           hostregex++;
           break;
@@ -746,6 +892,11 @@ template<class Data, class Result> int ControlMatcher<Data, Result>::BuildTableF
     reMatch->AllocateSpace(regex);
   }
 
+  if ((flags & ALLOW_URL_TABLE) && url > 0) {
+    urlMatch = NEW((new UrlMatcher<Data, Result> (matcher_name, config_file_path)));
+    urlMatch->AllocateSpace(url);
+  }
+
   if ((flags & ALLOW_HOST_TABLE) && hostDomain > 0) {
     hostMatch = NEW((new HostMatcher<Data, Result> (matcher_name, config_file_path)));
     hostMatch->AllocateSpace(hostDomain);
@@ -770,6 +921,8 @@ template<class Data, class Result> int ControlMatcher<Data, Result>::BuildTableF
       errPtr = hostMatch->NewEntry(current);
     } else if ((flags & ALLOW_REGEX_TABLE) && current->type == MATCH_REGEX) {
       errPtr = reMatch->NewEntry(current);
+    } else if ((flags & ALLOW_URL_TABLE) && current->type == MATCH_URL) {
+      errPtr = urlMatch->NewEntry(current);
     } else if ((flags & ALLOW_IP_TABLE) && current->type == MATCH_IP) {
       errPtr = ipMatch->NewEntry(current);
     } else if ((flags & ALLOW_HOST_REGEX_TABLE) && current->type == MATCH_HOST_REGEX) {
@@ -853,6 +1006,7 @@ template<class Data, class Result> int ControlMatcher<Data, Result>::BuildTable(
 template class ControlMatcher<ParentRecord, ParentResult>;
 template class HostMatcher<ParentRecord, ParentResult>;
 template class RegexMatcher<ParentRecord, ParentResult>;
+template class UrlMatcher<ParentRecord, ParentResult>;
 template class IpMatcher<ParentRecord, ParentResult>;
 template class HostRegexMatcher<ParentRecord, ParentResult>;
 
@@ -860,6 +1014,7 @@ template class HostRegexMatcher<ParentRecord, ParentResult>;
 template class ControlMatcher<SplitDNSRecord, SplitDNSResult>;
 template class HostMatcher<SplitDNSRecord, SplitDNSResult>;
 template class RegexMatcher<SplitDNSRecord, SplitDNSResult>;
+template class UrlMatcher<SplitDNSRecord, SplitDNSResult>;
 template class IpMatcher<SplitDNSRecord, SplitDNSResult>;
 template class HostRegexMatcher<SplitDNSRecord, SplitDNSResult>;
 #endif
@@ -868,6 +1023,7 @@ template class HostRegexMatcher<SplitDNSRecord, SplitDNSResult>;
 template class ControlMatcher<CacheControlRecord, CacheControlResult>;
 template class HostMatcher<CacheControlRecord, CacheControlResult>;
 template class RegexMatcher<CacheControlRecord, CacheControlResult>;
+template class UrlMatcher<CacheControlRecord, CacheControlResult>;
 template class IpMatcher<CacheControlRecord, CacheControlResult>;
 #endif
 
@@ -875,4 +1031,5 @@ template class ControlMatcher<CongestionControlRecord, CongestionControlRule>;
 template class HostMatcher<CongestionControlRecord, CongestionControlRule>;
 template class HostRegexMatcher<CongestionControlRecord, CongestionControlRule>;
 template class RegexMatcher<CongestionControlRecord, CongestionControlRule>;
+template class UrlMatcher<CongestionControlRecord, CongestionControlRule>;
 template class IpMatcher<CongestionControlRecord, CongestionControlRule>;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2d9ad48c/proxy/ControlMatcher.h
----------------------------------------------------------------------
diff --git a/proxy/ControlMatcher.h b/proxy/ControlMatcher.h
index 2c47f7d..bbf779e 100644
--- a/proxy/ControlMatcher.h
+++ b/proxy/ControlMatcher.h
@@ -159,6 +159,36 @@ public:
 };
 
 
+template<class Data, class Result> class UrlMatcher {
+public:
+  UrlMatcher(const char *name, const char *filename);
+  ~UrlMatcher();
+  void Match(RequestData * rdata, Result * result);
+  void AllocateSpace(int num_entries);
+  char *NewEntry(matcher_line * line_info);
+  void Print();
+  int getNumElements()
+  {
+    return num_el;
+  };
+  Data *getDataArray()
+  {
+    return data_array;
+  };
+#ifndef TS_MICRO
+protected:
+#endif
+  InkHashTable *url_ht;
+  char **url_str;                // array of url strings
+  int  *url_value;                // array of posion of url strings
+  Data *data_array;             // data array.  Corresponds to re_array
+  int array_len;                // length of the arrays (all three are the same length)
+  int num_el;                   // number of elements in the table
+  const char *matcher_name;     // Used for Debug/Warning/Error messages
+  const char *file_name;        // Used for Debug/Warning/Error messages
+};
+
+
 template<class Data, class Result> class RegexMatcher {
 public:
   RegexMatcher(const char *name, const char *filename);
@@ -258,13 +288,14 @@ public:
 #define ALLOW_IP_TABLE     1 << 1
 #define ALLOW_REGEX_TABLE  1 << 2
 #define ALLOW_HOST_REGEX_TABLE 1 << 3
-#define DONT_BUILD_TABLE     1 << 4     // for testing
+#define ALLOW_URL_TABLE 1 << 4
+#define DONT_BUILD_TABLE     1 << 5     // for testing
 
 template<class Data, class Result> class ControlMatcher {
 public:
   // Parameter name must not be deallocated before this
   //  object is
-  ControlMatcher(const char *file_var, const char *name, const matcher_tags * tags, int flags_in = 0xf);
+  ControlMatcher(const char *file_var, const char *name, const matcher_tags * tags, int flags_in = (ALLOW_HOST_TABLE | ALLOW_IP_TABLE | ALLOW_REGEX_TABLE | ALLOW_HOST_REGEX_TABLE | ALLOW_URL_TABLE));
   ~ControlMatcher();
   int BuildTable();
   int BuildTableFromString(char *str);
@@ -281,6 +312,9 @@ public:
   RegexMatcher<Data, Result> *getReMatcher() {
     return reMatch;
   }
+  UrlMatcher<Data, Result> *getUrlMatcher() {
+    return urlMatch;
+  }
   IpMatcher<Data, Result> *getIPMatcher() {
     return ipMatch;
   }
@@ -290,6 +324,7 @@ public:
 
   //private:
   RegexMatcher<Data, Result> *reMatch;
+  UrlMatcher<Data, Result> *urlMatch;
   HostMatcher<Data, Result> *hostMatch;
   IpMatcher<Data, Result> *ipMatch;
   HostRegexMatcher<Data, Result> *hrMatch;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2d9ad48c/proxy/ParentSelection.cc
----------------------------------------------------------------------
diff --git a/proxy/ParentSelection.cc b/proxy/ParentSelection.cc
index 72be4dd..bb9e4ca 100644
--- a/proxy/ParentSelection.cc
+++ b/proxy/ParentSelection.cc
@@ -1025,7 +1025,7 @@ EXCLUSIVE_REGRESSION_TEST(PARENTSELECTION) (RegressionTest * /* t ATS_UNUSED */,
   params->ParentEnable = true;
   char tbl[2048];
 #define T(x) ink_strlcat(tbl,x, sizeof(tbl));
-#define REBUILD params->ParentTable = new P_table("", "ParentSelection Unit Test Table", &http_dest_tags, ALLOW_HOST_TABLE | ALLOW_REGEX_TABLE | ALLOW_IP_TABLE | DONT_BUILD_TABLE); params->ParentTable->BuildTableFromString(tbl);
+#define REBUILD params->ParentTable = new P_table("", "ParentSelection Unit Test Table", &http_dest_tags, ALLOW_HOST_TABLE | ALLOW_REGEX_TABLE | ALLOW_URL_TABLE | ALLOW_IP_TABLE | DONT_BUILD_TABLE); params->ParentTable->BuildTableFromString(tbl);
   HttpRequestData *request = NULL;
   ParentResult *result = NULL;
 #define REINIT delete request; delete result; request = new HttpRequestData(); result = new ParentResult(); if (!result || !request) { (void)printf("Allocation failed\n"); return; }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2d9ad48c/proxy/congest/Congestion.cc
----------------------------------------------------------------------
diff --git a/proxy/congest/Congestion.cc b/proxy/congest/Congestion.cc
index 17fc6e8..f50a535 100644
--- a/proxy/congest/Congestion.cc
+++ b/proxy/congest/Congestion.cc
@@ -45,6 +45,7 @@ static const matcher_tags congest_dest_tags = {
   "dest_domain",
   "dest_ip",
   NULL,
+  NULL,
   "host_regex",
   true
 };


Re: git commit: TS-1280 add url match token about cache control rule

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> Updated Branches:
>   refs/heads/master 0257a617b -> 2d9ad48c5
> 
> 
> TS-1280 add url match token about cache control rule
> ----------------------------------------------------------------------
> diff --git a/CHANGES b/CHANGES
> index 5597d10..5bcf4f3 100644
> --- a/CHANGES
> +++ b/CHANGES
> @@ -2,6 +2,8 @@
>  Changes with Apache Traffic Server 3.3.5
>  
>  
> +  *) [TS-1280] add url match token about cache control rule.
> +

s/about/to/

having an example in the config file and our documentation on how
to use this would be extremely helpful.

-- i
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE