You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2015/05/09 07:00:14 UTC

trafficserver git commit: TS-3592: Set cacheurl default config location to config directory

Repository: trafficserver
Updated Branches:
  refs/heads/master 372e03077 -> f4c631d17


TS-3592: Set cacheurl default config location to config directory


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

Branch: refs/heads/master
Commit: f4c631d175d8b8dcc95e05205d05839c318b6faf
Parents: 372e030
Author: Phil Sorber <so...@apache.org>
Authored: Fri May 8 21:48:31 2015 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Fri May 8 22:56:56 2015 -0600

----------------------------------------------------------------------
 CHANGES                      | 2 ++
 plugins/cacheurl/cacheurl.cc | 9 +++++----
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f4c631d1/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 958c0f7..554d1c9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 6.0.0
 
+  *) [TS-3592] Set cacheurl default config location to config directory.
+
   *) [TS-3590]: Mark H2 fetch streams as non-internal requests
 
   *) [TS-3370] header_rewrite plugin uses dead continuation.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f4c631d1/plugins/cacheurl/cacheurl.cc
----------------------------------------------------------------------
diff --git a/plugins/cacheurl/cacheurl.cc b/plugins/cacheurl/cacheurl.cc
index 5f03598..52565fc 100644
--- a/plugins/cacheurl/cacheurl.cc
+++ b/plugins/cacheurl/cacheurl.cc
@@ -42,6 +42,7 @@
 #define TOKENCOUNT 10
 #define OVECOUNT 30
 #define PLUGIN_NAME "cacheurl"
+#define DEFAULT_CONFIG "cacheurl.config"
 
 struct regex_info {
   pcre *re;          /* Compiled regular expression */
@@ -213,10 +214,10 @@ load_config_file(const char *config_file)
   regex_info *info = 0;
 
   if (config_file == NULL) {
-    /* Default config file of plugins/cacheurl.config */
-    path = TSPluginDirGet();
-    path += "/cacheurl.config";
-  } else if (*config_file != '/') {
+    config_file = DEFAULT_CONFIG;
+  }
+
+  if (*config_file != '/') {
     // Relative paths are relative to the config directory
     path = TSConfigDirGet();
     path += "/";